/*--------------------------------------------------------------------
 *    The MB-system:	mbsys_simrad.h	8/5/94
 *	$Id: mbsys_simrad.h 1917 2012-01-10 19:25:33Z caress $
 *
 *    Copyright (c) 1994-2012 by
 *    David W. Caress (caress@mbari.org)
 *      Monterey Bay Aquarium Research Institute
 *      Moss Landing, CA 95039
 *    and Dale N. Chayes (dale@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);

