#include <boost/test/unit_test.hpp>
#include <usml/ocean/ocean.h>
#include <usml/ocean/reflect_loss_netcdf.h>
BOOST_AUTO_TEST_SUITE(reflect_loss_netcdf_test)
using namespace boost::unit_test;
using namespace usml::ocean;
cout << " === reflection_loss_test: reflection_loss_netcdf bottom province file === " << endl;
reflect_loss_netcdf netcdf( USML_DATA_DIR "/bottom_province/sediment_test.nc" );
seq_linear frequency(1000.0, 10000.0, 0.01);
double angle = 0;
vector<double> amplitude( frequency.size() );
double limestone = 3.672875;
double sand = 10.166660;
double tolerance = 1e-5;
netcdf.reflect_loss(wposition1(29.5, -83.4), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), limestone, tolerance);
netcdf.reflect_loss(wposition1(30.5, -83.4), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), sand, tolerance);
netcdf.reflect_loss(wposition1(29.5, -84.2), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), sand, tolerance);
netcdf.reflect_loss(wposition1(30.5, -84.2), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), limestone, tolerance);
netcdf.reflect_loss(wposition1(26, -80), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), sand, tolerance);
netcdf.reflect_loss(wposition1(26, -89), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), sand, tolerance);
netcdf.reflect_loss(wposition1(35, -80), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), limestone, tolerance);
netcdf.reflect_loss(wposition1(35, -89), frequency, angle, &litude);
BOOST_CHECK_CLOSE(amplitude(0), limestone, tolerance);
cout << "\tAll tests passed.\t" << endl;
}
BOOST_AUTO_TEST_SUITE_END()