World Ocean Simulation System (WOSS) library
woss::ArrBinResReader Class Reference

Class for reading and manipulating results provided by any acoustic toolbox binary ARR file. More...

#include <ac-toolbox-arr-bin-reader.h>

Inheritance diagram for woss::ArrBinResReader:
Inheritance graph
Collaboration diagram for woss::ArrBinResReader:
Collaboration graph

Public Member Functions

 ArrBinResReader ()
 
 ArrBinResReader (const Woss *const woss)
 
virtual bool initialize ()
 
virtual PressurereadAvgPressure (double frequency, double tx_depth, double start_rx_depth, double start_rx_range, double end_rx_depth, double end_rx_range)
 
virtual PressurereadPressure (double frequency, double tx_depth, double rx_depth, double rx_range) const
 
virtual TimeArrreadTimeArr (double frequency, double tx_depth, double rx_depth, double rx_range) const
 
- Public Member Functions inherited from woss::ResReader
 ResReader ()
 
 ResReader (const Woss *const woss)
 
ResReadersetWossPtr (const Woss *const woss)
 
const Woss *const getWossPtr ()
 
ResReadersetFileName (const ::std::string &name)
 
::std::string getFileName ()
 

Protected Member Functions

TimeArraccessMap (double frequency, double tx_depth, double rx_depth, double rx_range) const
 
::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)
 
bool getArrBinHeader ()
 
bool getArrBinFile ()
 

Protected Attributes

bool arr_bin_header_collected
 
bool arr_bin_file_collected
 
::std::ifstream file_reader
 
::std::streampos skip_header
 
ArrData arr_file
 
double last_tx_depth
 
double last_start_rx_depth
 
double last_start_rx_range
 
double last_end_rx_depth
 
double last_end_rx_range
 
::std::complex< double > last_ret_value
 
- Protected Attributes inherited from woss::ResReader
const Wosswoss_ptr
 
::std::string file_name
 

Detailed Description

Class for reading and manipulating results provided by any acoustic toolbox binary ARR file.

Class ArrAscResReader stores TimeArr provided by any acoustic toolbox binary ARR file in a ArrStruct. It also offers TimeArr manipulation and Pressure conversion methods.

Constructor & Destructor Documentation

◆ ArrBinResReader() [1/2]

ArrBinResReader::ArrBinResReader ( )

ArrBinResReader default constructor

◆ ArrBinResReader() [2/2]

ArrBinResReader::ArrBinResReader ( const Woss *const  woss)

ArrBinResReader constructor

Parameters
wossconst pointer to a const Woss object

Member Function Documentation

◆ accessMap()

TimeArr * woss::ArrBinResReader::accessMap ( double  frequency,
double  tx_depth,
double  rx_depth,
double  rx_range 
) const
inlineprotected

Gets the TimeArr value from ArrData TimeArr array associated to given parameters

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
rx_depthstart receiver depth [m]
rx_rangestart receiver range [m]
Returns
a valid TimeArr value; a not valid TimeArr if arr_file hasn't been read yet

References arr_file, woss::ArrData::arr_values, and woss::ArrData::getTimeArrIndex().

Referenced by readTimeArr().

Here is the call graph for this function:

◆ getArrBinFile()

◆ getArrBinHeader()

◆ initialize()

bool ArrBinResReader::initialize ( )
virtual

Initializes the ArrBinResReader object, reads ARR file, and stores read TimeArr values

Returns
true if method was successful, false otherwise

Implements woss::ResReader.

References woss::ResReader::file_name, getArrBinFile(), getArrBinHeader(), and woss::ResReader::woss_ptr.

Here is the call graph for this function:

◆ readAvgPressure()

Pressure * ArrBinResReader::readAvgPressure ( double  frequency,
double  tx_depth,
double  start_rx_depth,
double  start_rx_range,
double  end_rx_depth,
double  end_rx_range 
)
virtual

Gets the average Pressure value in given rx range-depth box. Returned Pressure is the coherent sum of the computed average TimeArr

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
start_rx_depthstart receiver depth [m]
start_rx_rangestart receiver range [m]
end_rx_depthend receiver depth [m]
end_rx_rangeend receiver range [m]
Returns
a valid Pressure value; a not valid Pressure if arr_file hasn't been read yet

Implements woss::ResReader.

References arr_bin_file_collected, woss::Pressure::create(), woss::Pressure::createNotValid(), woss::Singleton< T >::instance(), and readMapAvgPressure().

Here is the call graph for this function:

◆ readMapAvgPressure()

std::complex< double > ArrBinResReader::readMapAvgPressure ( double  frequency,
double  tx_depth,
double  start_rx_depth,
double  start_rx_range,
double  end_rx_depth,
double  end_rx_range 
)
protected

Gets the average Pressure value in given rx range-depth box converted from ArrStruct TimeArr array

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
start_rx_depthstart receiver depth [m]
start_rx_rangestart receiver range [m]
end_rx_depthend receiver depth [m]
end_rx_rangeend receiver range [m]
Returns
a valid Pressure value; a not valid Pressure if arr_file hasn't been read yet

References arr_file, woss::ArrData::arr_values, woss::ArrData::getTimeArrIndex(), woss::Woss::getWossId(), woss::Woss::usingDebug(), and woss::ResReader::woss_ptr.

Referenced by readAvgPressure().

Here is the call graph for this function:

◆ readPressure()

Pressure * ArrBinResReader::readPressure ( double  frequency,
double  tx_depth,
double  rx_depth,
double  rx_range 
) const
virtual

Gets a Pressure value for given range, depths. Returned Pressure is the coherent sum of the computed TimeArr

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
rx_depthreceiver depth [m]
rx_rangereceiver range [m]
Returns
a valid Pressure value; a not valid Pressure if arr_file hasn't been read yet

Implements woss::ResReader.

References woss::Singleton< T >::instance(), and readTimeArr().

Here is the call graph for this function:

◆ readTimeArr()

TimeArr * ArrBinResReader::readTimeArr ( double  frequency,
double  tx_depth,
double  rx_depth,
double  rx_range 
) const
virtual

Gets a TimeArr value for given range, depths

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
rx_depthreceiver depth [m]
rx_rangereceiver range [m]
Returns
a valid TimeArr value; a not valid TimeArr if arr_file hasn't been read yet

Implements woss::ResReader.

References accessMap(), arr_bin_file_collected, woss::TimeArr::create(), woss::TimeArr::createNotValid(), and woss::Singleton< T >::instance().

Referenced by readPressure().

Here is the call graph for this function:

Member Data Documentation

◆ arr_bin_file_collected

bool woss::ArrBinResReader::arr_bin_file_collected
protected

Boolean associated to the reading of ARR file data

Referenced by getArrBinFile(), readAvgPressure(), and readTimeArr().

◆ arr_bin_header_collected

bool woss::ArrBinResReader::arr_bin_header_collected
protected

Boolean associated to the reading of ARR file header

Referenced by getArrBinFile(), and getArrBinHeader().

◆ arr_file

ArrData woss::ArrBinResReader::arr_file
protected

Struct that holds TimeArr data read from ARR file

Referenced by accessMap(), getArrBinFile(), getArrBinHeader(), and readMapAvgPressure().

◆ file_reader

::std::ifstream woss::ArrBinResReader::file_reader
protected

Input file stream

Referenced by getArrBinFile(), and getArrBinHeader().

◆ skip_header

::std::streampos woss::ArrBinResReader::skip_header
protected

Total lines to skip if ARR file header has already been read

Referenced by getArrBinFile(), and getArrBinHeader().


The documentation for this class was generated from the following files: