World Ocean Simulation System (WOSS) library
ac-toolbox-arr-bin-reader.h
Go to the documentation of this file.
1/* WOSS - World Ocean Simulation System -
2 *
3 * Copyright (C) 2009 2025 Federico Guerra
4 * and regents of the SIGNET lab, University of Padova
5 *
6 * Author: Federico Guerra - WOSS@guerra-tlc.com
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation;
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22
23
34#ifndef AC_TOOLBOX_ARR_BIN_READER_DEFINITIONS_H
35#define AC_TOOLBOX_ARR_BIN_READER_DEFINITIONS_H
36
37
39
40namespace woss {
41
48 class ArrBinResReader : public ResReader {
49
50 public:
51
56 ArrBinResReader( const Woss& woss );
57
58 virtual ~ArrBinResReader() override = default;
59
64 virtual bool initialize() override;
65
77 virtual std::unique_ptr<Pressure> readAvgPressure( double frequency, double tx_depth, double start_rx_depth, double start_rx_range, double end_rx_depth, double end_rx_range ) override;
78
88 virtual std::unique_ptr<Pressure> readPressure(double frequency, double tx_depth, double rx_depth, double rx_range ) const override;
89
98 virtual std::unique_ptr<TimeArr> readTimeArr(double frequency, double tx_depth, double rx_depth, double rx_range ) const override;
99
100 protected:
101
106
111
115 std::ifstream file_reader;
116
120 std::streampos skip_header;
121
126
128
130
132
134
136
137 std::complex<double> last_ret_value;
138
147 const TimeArr& accessMap(double frequency, double tx_depth, double rx_depth, double rx_range) const {
148 return( (arr_file.arr_values[arr_file.getTimeArrIndex( tx_depth, rx_depth, rx_range )] ) );
149 }
150
161 std::complex<double> readMapAvgPressure( double frequency, double tx_depth, double start_rx_depth, double start_rx_range, double end_rx_depth, double end_rx_range );
162
167 bool getArrBinHeader();
168
173 bool getArrBinFile();
174
175 };
176
177}
178
179#endif /* AC_TOOLBOX_ARR_BIN_READER_DEFINITIONS_H */
Provides the interface for woss::ArrAscResReader and woss::ArrData classes.
Class for reading and manipulating results provided by any acoustic toolbox binary ARR file.
Definition ac-toolbox-arr-bin-reader.h:48
virtual bool initialize() override
Definition ac-toolbox-arr-bin-reader.cpp:66
std::complex< double > last_ret_value
Definition ac-toolbox-arr-bin-reader.h:137
bool arr_bin_header_collected
Definition ac-toolbox-arr-bin-reader.h:105
bool arr_bin_file_collected
Definition ac-toolbox-arr-bin-reader.h:110
ArrData arr_file
Definition ac-toolbox-arr-bin-reader.h:125
std::complex< double > readMapAvgPressure(double frequency, double tx_depth, double start_rx_depth, double start_rx_range, double end_rx_depth, double end_rx_range)
Definition ac-toolbox-arr-bin-reader.cpp:355
double last_tx_depth
Definition ac-toolbox-arr-bin-reader.h:127
double last_end_rx_range
Definition ac-toolbox-arr-bin-reader.h:135
virtual std::unique_ptr< Pressure > readAvgPressure(double frequency, double tx_depth, double start_rx_depth, double start_rx_range, double end_rx_depth, double end_rx_range) override
Definition ac-toolbox-arr-bin-reader.cpp:341
virtual std::unique_ptr< TimeArr > readTimeArr(double frequency, double tx_depth, double rx_depth, double rx_range) const override
Definition ac-toolbox-arr-bin-reader.cpp:348
bool getArrBinHeader()
Definition ac-toolbox-arr-bin-reader.cpp:76
std::streampos skip_header
Definition ac-toolbox-arr-bin-reader.h:120
bool getArrBinFile()
Definition ac-toolbox-arr-bin-reader.cpp:194
virtual ~ArrBinResReader() override=default
virtual std::unique_ptr< Pressure > readPressure(double frequency, double tx_depth, double rx_depth, double rx_range) const override
Definition ac-toolbox-arr-bin-reader.cpp:336
double last_start_rx_depth
Definition ac-toolbox-arr-bin-reader.h:129
const TimeArr & accessMap(double frequency, double tx_depth, double rx_depth, double rx_range) const
Definition ac-toolbox-arr-bin-reader.h:147
double last_end_rx_depth
Definition ac-toolbox-arr-bin-reader.h:133
double last_start_rx_range
Definition ac-toolbox-arr-bin-reader.h:131
std::ifstream file_reader
Definition ac-toolbox-arr-bin-reader.h:115
class for storing data of any acoustic toolbox ARR file
Definition ac-toolbox-arr-asc-reader.h:51
int getTimeArrIndex(double tx_depth, double rx_depth, double rx_range) const
Definition ac-toolbox-arr-asc-reader.cpp:72
std::unique_ptr< TimeArr[] > arr_values
Definition ac-toolbox-arr-asc-reader.h:97
Abstract class for channel simulator result files processing.
Definition res-reader.h:52
Channel power delay profile class.
Definition time-arrival-definitions.h:70
Abstract class that provides the interface for initializing and running a channel simulator.
Definition woss.h:76
Definition ac-toolbox-arr-asc-reader.h:44