FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
SensorEchosounder Class Reference
+ Inheritance diagram for SensorEchosounder:
+ Collaboration diagram for SensorEchosounder:

Classes

struct  Reading
 The altimeter reading held on the output ports between pings. More...
 
struct  Settings
 Everything the instrument is configured with. More...
 
struct  Species
 One species as the acoustic model sees it. More...
 

Public Member Functions

 SensorEchosounder (std::string simObjectName, ISimObjectCreator *creator)
 
 SensorEchosounder (std::string simObjectName, const Settings &settings)
 
 ~SensorEchosounder () override
 Flushes and closes the echogram file, and releases the visualisation geometry.
 
void OdeFcn (const double dT, const double *const adX, double *const adXDot) const override
 Writes no derivatives: this SimObject declares no states.
 
void AcceptedStep (const double dT, const double *const adX) override
 
void FinalSetup (const double dT, const double *const adX, ISimObjectCreator *const creator) override
 
const ReadingHeldReading () const
 The reading currently held on the output ports.
 
const SettingsGetSettings () const
 The settings the instrument was built with.
 
const std::vector< Species > & GetSpecies () const
 The species entering the acoustic model, in file column order.
 
int PingsTaken () const
 The number of pings taken so far.
 
const std::vector< double > & Frequencies () const
 The operating frequencies, kHz.
 

Static Public Member Functions

static double PerturbRange (double trueRange, const Settings &settings, SensorNoise &noise)
 
static double AltitudeOf (double slantRange, const double beamDirection[3])
 
static int BinIndexOf (double range, double binSize)
 
static double TargetStrengthDb (const Species &species, double frequencykHz)
 
static double BackscatterCrossSection (const Species &species, double frequencykHz)
 
static double NoiseFloorLinear (double noiseSvAt1mDb, double absorptionDbPerKm, double range)
 

Protected Member Functions

const double * OutSeafloorDistance (const double dT, const double *const adX)
 The measured slant range to the seafloor, m.
 
const double * OutSeafloorDepth (const double dT, const double *const adX)
 The inferred depth of the seafloor, m.
 
const double * OutAltitude (const double dT, const double *const adX)
 The measured height above the seafloor, m.
 
const double * OutValid (const double dT, const double *const adX)
 One when the last ping found a bottom, zero otherwise.
 
const double * OutPingTime (const double dT, const double *const adX)
 The time of the ping the held reading came from, s.
 

Constructor & Destructor Documentation

◆ SensorEchosounder() [1/2]

SensorEchosounder::SensorEchosounder ( std::string  simObjectName,
ISimObjectCreator *  creator 
)

Constructs the sounder from the simulation input file.

Parameters
simObjectNameThe name of this object in the simulation.
creatorThe creator of this object.

◆ SensorEchosounder() [2/2]

SensorEchosounder::SensorEchosounder ( std::string  simObjectName,
const Settings settings 
)

Constructs the sounder with its settings given directly.

No ports are registered and no file is opened, so OdeFcn, AcceptedStep and FinalSetup all do nothing and the pure parts must be exercised directly. This constructor exists so that the geometry and the acoustic model can be unit tested without a host simulation, which matters because ISimObjectCreator has some thirty pure virtuals and FhSim exports no mock.

Parameters
simObjectNameThe name of this object.
settingsThe instrument settings.

Member Function Documentation

◆ AcceptedStep()

void SensorEchosounder::AcceptedStep ( const double  dT,
const double *const  adX 
)
override

Takes every ping that has fallen due since the previous accepted step.

Parameters
dTThe current simulation time, s.
adXThe state vector.

◆ AltitudeOf()

static double SensorEchosounder::AltitudeOf ( double  slantRange,
const double  beamDirection[3] 
)
static

Projects a slant range onto the vertical.

Parameters
slantRangeThe slant range along the beam, m.
beamDirectionThe unit beam direction in NED.
Returns
The vertical component of the slant range, m, always non-negative.

◆ BackscatterCrossSection()

static double SensorEchosounder::BackscatterCrossSection ( const Species species,
double  frequencykHz 
)
static

The backscattering cross section of one species at one frequency.

Parameters
speciesThe species and its acoustic properties.
frequencykHzThe frequency, kHz.
Returns
The cross section, m^2.

◆ BinIndexOf()

static int SensorEchosounder::BinIndexOf ( double  range,
double  binSize 
)
static

The index of the range bin a distance falls in.

Parameters
rangeThe slant range, m.
binSizeThe bin size, m.
Returns
The bin index, which is zero for a non-positive range or bin size.

◆ FinalSetup()

void SensorEchosounder::FinalSetup ( const double  dT,
const double *const  adX,
ISimObjectCreator *const  creator 
)
override

Resolves the environment and the species fields, and opens the echogram file.

Parameters
dTThe initial simulation time, s.
adXThe state vector.
creatorThe creator of this object.

◆ NoiseFloorLinear()

static double SensorEchosounder::NoiseFloorLinear ( double  noiseSvAt1mDb,
double  absorptionDbPerKm,
double  range 
)
static

The modelled noise floor of one bin.

Parameters
noiseSvAt1mDbThe noise floor referred to one metre, dB.
absorptionDbPerKmThe absorption coefficient, dB/km.
rangeThe slant range of the bin centre, m.
Returns
The noise floor as a linear volume backscattering coefficient, 1/m.

◆ PerturbRange()

static double SensorEchosounder::PerturbRange ( double  trueRange,
const Settings settings,
SensorNoise noise 
)
static

Applies the range bias and the two range noise terms.

Parameters
trueRangeThe geometric slant range, m.
settingsThe instrument settings.
noiseThe random generator; a deterministic one leaves the range alone.
Returns
The range the instrument reports, m.

◆ TargetStrengthDb()

static double SensorEchosounder::TargetStrengthDb ( const Species species,
double  frequencykHz 
)
static

The target strength of one species at one frequency.

Parameters
speciesThe species and its acoustic properties.
frequencykHzThe frequency, kHz.
Returns
The target strength, dB.

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