#define NUM_ARRAYS 5 #define NUM_ELEMENTS_PER_ARRAY 30 #define ANCHOR_TO_HF_HYDROPHONE_OFFSET 1.86 /* meters */ #ifndef BUFFER_LENGTH #define BUFFER_LENGTH 4096 #endif #define LF_SAMPLE_RATE 4000 /* samples/second */ #ifdef CRAYMPP #define RAM_BUFFER_SIZE 4096 /* bytes */ #else #define RAM_BUFFER_SIZE 16384 #endif #ifndef RAM_UTIL_DEF #define RAM_UTIL_DEF #endif #ifndef BATH_UTIL_DEF #include "bath-util.h" #endif /* * Define an unsigned integer as type UINT, for compatability with * CASDE file formats */ #ifndef UINT typedef int UINT; #endif /* * Include the complex library */ #ifndef COMPLEX_DEF #include "complex.h" #endif typedef struct svp_struct { int nz; double *z, *c; } SVP; typedef struct ram_struct { int lz, lr; double f; double zmin, zmax, rmin, rmax; double rng0, rng1; double rmax1, dr2; double dz, dr; int grid_start, cf_offset; double *z, *r; complex **cf; complex *cf_buffer; int buffer_start, buffer_end; int file_size; } RAM; typedef struct ael_struct { int acoid, cn; double r, x, y, z; } AEL; typedef struct ram_companion_struct { int acoid; double sx, sy, sdepth; double bx, by; double c0, range_step; /* recip flags */ unsigned int recip_flag; double recip_base, recip_r; double cx, cy, center_range; int cn; /* grid flags */ unsigned int grid_flag, scale_flag; double grid_r_min, grid_delta_r; int grid_r_index, grid_nr; double grid_z_min, grid_delta_z; int grid_z_index, grid_nz; double grid_bearing; unsigned int project_flag; } RAM_COMPANION; typedef struct irig_time_struct { UINT yearday; UINT hour; UINT minute; UINT second; UINT usec; } IrigTime; typedef struct output_file_header_struct { UINT byteorder; /* Byte order -- this is 1 */ UINT acoid; /* ACO ID for stream */ UINT cn; /* Channel number within ACO */ double fs; /* Sampling rate (Hz) */ UINT data_format; /* Data type: short or long integer? */ UINT starting_frame; /* Starting frame number in file */ IrigTime zero_time; /* C time structure indicating time of zeroth frame (IRIG) */ IrigTime starting_time; /* C time structure indicating time of first frame (derived) */ } OutputFileHeader; AEL *read_ael_output (FILE *, int *); double **read_bottom_receiver_positions (FILE *); void correct_ael (AEL *, int, double, double **); complex read_ram_pressure_cell (FILE *fp, RAM *ram, int, int); RAM *read_ram_output (FILE *); RAM *read_ram_output_header (FILE *); complex *read_recip_pressure_field (int, FILE **, RAM **, int, int); complex read_ram_pressure_cell (FILE *, RAM *, int, int); int read_ram_pressure_field (FILE *, RAM *); RAM_COMPANION *read_ram_companion_file(FILE *); complex interpolate_complex_pressure (RAM *, RAM_COMPANION *, double, double); complex spline_complex_pressure (RAM *, RAM_COMPANION *, double, double); complex *spline_complex_pressure_range (RAM *, RAM_COMPANION *, double); complex *spline_complex_pressure_range_precision (RAM *, RAM_COMPANION *, double); int write_normalized_time_data(char *, int, int, double, double, complex, double, double); int write_ram_output (FILE *, RAM *, unsigned int); int write_output_file_header (OutputFileHeader, FILE *); SVP *read_baseline_water_svp (FILE *); void write_ram_setup (FILE *, Bathymetric *, SVP *, double, double, double, double, double, double, double, double, double, double, unsigned int, unsigned int, unsigned int, double, double, double); void write_standard_svp (FILE *, SVP *, double); int write_companion_file (FILE *, int, double, double, double, double, double, double, double, unsigned int, unsigned int, unsigned int, unsigned int, double, double, int, int, double, double, int, int, double, double, double, double, double, double, int); void tide_compensation (Bathymetric *, double); int initialize_regrid_file (FILE *, RAM_COMPANION *, RAM *, unsigned int); int write_sparse_pressure (FILE *, int, int, int, int, int, int, int, complex); int dump_pressure_field (FILE *, RAM_COMPANION *, complex ***); void project_ael (double, double, double **p, double, AEL *, int);