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

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

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

Inheritance diagram for woss::ArrAscResReader:
Inheritance graph
Collaboration diagram for woss::ArrAscResReader:
Collaboration graph

Public Member Functions

 ArrAscResReader ()
 
 ArrAscResReader (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 getArrAscHeader ()
 
bool getArrAscFile ()
 

Protected Attributes

bool arr_asc_header_collected
 
bool arr_asc_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 textual ARR file.

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

Constructor & Destructor Documentation

◆ ArrAscResReader() [1/2]

ArrAscResReader::ArrAscResReader ( )

ArrAscResReader default constructor

◆ ArrAscResReader() [2/2]

ArrAscResReader::ArrAscResReader ( const Woss *const  woss)

ArrAscResReader constructor

Parameters
wossconst pointer to a const Woss object

Member Function Documentation

◆ accessMap()

TimeArr * woss::ArrAscResReader::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
frequency[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:

◆ getArrAscFile()

◆ getArrAscHeader()

◆ initialize()

bool ArrAscResReader::initialize ( )
virtual

Initializes the ArrAscResReader 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, getArrAscFile(), getArrAscHeader(), and woss::ResReader::woss_ptr.

Here is the call graph for this function:

◆ readAvgPressure()

Pressure * ArrAscResReader::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_asc_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 > ArrAscResReader::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 ArrData 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 * ArrAscResReader::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 * ArrAscResReader::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_asc_file_collected, woss::TimeArr::createNotValid(), and woss::Singleton< T >::instance().

Referenced by readPressure().

Here is the call graph for this function:

Member Data Documentation

◆ arr_asc_file_collected

bool woss::ArrAscResReader::arr_asc_file_collected
protected

Boolean associated to the reading of ARR file data

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

◆ arr_asc_header_collected

bool woss::ArrAscResReader::arr_asc_header_collected
protected

Boolean associated to the reading of ARR file header

Referenced by getArrAscFile(), and getArrAscHeader().

◆ arr_file

ArrData woss::ArrAscResReader::arr_file
protected

Struct that holds TimeArr data read from ARR file

Referenced by accessMap(), getArrAscFile(), getArrAscHeader(), and readMapAvgPressure().

◆ file_reader

::std::ifstream woss::ArrAscResReader::file_reader
protected

Input file stream

Referenced by getArrAscFile(), and getArrAscHeader().

◆ skip_header

::std::streampos woss::ArrAscResReader::skip_header
protected

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

Referenced by getArrAscFile(), and getArrAscHeader().


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