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

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

#include <ac-toolbox-shd-reader.h>

Inheritance diagram for woss::ShdResReader:
Inheritance graph
Collaboration diagram for woss::ShdResReader:
Collaboration graph

Public Member Functions

 ShdResReader ()
 
 ShdResReader (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

::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, double theta=0.0)
 
::std::complex< double > accessMap (double frequency, double tx_depth, double rx_depth, double rx_range, double theta=0.0) const
 
bool getShdFile ()
 
bool getShdHeader ()
 

Protected Attributes

bool shd_header_collected
 
bool shd_file_collected
 
::std::ifstream file_reader
 
ShdData shd_file
 
ShdData_v1 shd_file_v1
 
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 SHD file.

Class ShdResReader stores Pressure provided by any acoustic toolbox SHD file in a ShdData. It also offers Pressure manipulation and TimeArr conversion methods.

Constructor & Destructor Documentation

◆ ShdResReader() [1/2]

ShdResReader::ShdResReader ( )

ShdResReader default constructor

◆ ShdResReader() [2/2]

ShdResReader::ShdResReader ( const Woss *const  woss)

ShdResReader constructor

Parameters
wossconst pointer to a const Woss object

Member Function Documentation

◆ accessMap()

std::complex< double > ShdResReader::accessMap ( double  frequency,
double  tx_depth,
double  rx_depth,
double  rx_range,
double  theta = 0.0 
) const
protected

Gets the Pressure value from ShdData Pressure array associated to given parameters

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

References woss::BellhopWoss::getBellhopShdSyntax(), woss::ShdData::getPressureIndex(), woss::ShdData_v1::getPressureIndex(), woss::Woss::getWossId(), woss::ShdData::press_values, woss::ShdData_v1::press_values, shd_file, shd_file_v1, and woss::ResReader::woss_ptr.

Referenced by readPressure(), and readTimeArr().

Here is the call graph for this function:

◆ getShdFile()

◆ getShdHeader()

◆ initialize()

bool ShdResReader::initialize ( )
virtual

Initializes the ShdResReader object, reads SHD file, and stores read Pressure values

Returns
true if method was successful, false otherwise

Implements woss::ResReader.

References woss::ResReader::file_name, getShdFile(), getShdHeader(), and woss::ResReader::woss_ptr.

Here is the call graph for this function:

◆ readAvgPressure()

Pressure * ShdResReader::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

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 shd_file hasn't been read yet

Implements woss::ResReader.

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

Here is the call graph for this function:

◆ readMapAvgPressure()

std::complex< double > ShdResReader::readMapAvgPressure ( double  frequency,
double  tx_depth,
double  start_rx_depth,
double  start_rx_range,
double  end_rx_depth,
double  end_rx_range,
double  theta = 0.0 
)
protected

Gets the average Pressure value in given rx range-depth box from ShdData Pressure 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]
thetatheta value
Returns
a valid Pressure value; a not valid Pressure if shd_file hasn't been read yet

References woss::BellhopWoss::getBellhopShdSyntax(), woss::ShdData::getPressureIndex(), woss::ShdData_v1::getPressureIndex(), woss::Woss::getWossId(), woss::ShdData::press_values, woss::ShdData_v1::press_values, shd_file, shd_file_v1, woss::Woss::usingDebug(), and woss::ResReader::woss_ptr.

Referenced by readAvgPressure().

Here is the call graph for this function:

◆ readPressure()

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

Gets a Pressure value of given range, depths

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 shd_file hasn't been read yet

Implements woss::ResReader.

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

Here is the call graph for this function:

◆ readTimeArr()

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

SHD files don't hold any time arrivals information. A special TimeArr is constructed from Pressure associated to given paramaters.

Parameters
frequencyfrequency [hZ]
tx_depthtransmitter depth [m]
rx_depthreceiver depth [m]
rx_rangereceiver range [m]
Returns
a special TimeArr that holds a single Pressure value and no delay information

Implements woss::ResReader.

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

Here is the call graph for this function:

Member Data Documentation

◆ file_reader

::std::ifstream woss::ShdResReader::file_reader
protected

Input file stream

Referenced by getShdFile(), and getShdHeader().

◆ shd_file

ShdData woss::ShdResReader::shd_file
protected

Struct that holds Pressure data read from SHD file

Referenced by accessMap(), getShdFile(), getShdHeader(), and readMapAvgPressure().

◆ shd_file_collected

bool woss::ShdResReader::shd_file_collected
protected

Boolean associated to the reading of SHD file data

Referenced by getShdFile(), readAvgPressure(), readPressure(), and readTimeArr().

◆ shd_file_v1

ShdData_v1 woss::ShdResReader::shd_file_v1
protected

Struct that holds Pressure data read from SHD file with V1 syntax

Referenced by accessMap(), getShdFile(), getShdHeader(), and readMapAvgPressure().

◆ shd_header_collected

bool woss::ShdResReader::shd_header_collected
protected

Boolean associated to the reading of SHD file header

Referenced by getShdHeader().


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