diff --git a/src/data_tools/include/data_tools/std_data.h b/src/data_tools/include/data_tools/std_data.h index 698d060d..8ac1c83e 100644 --- a/src/data_tools/include/data_tools/std_data.h +++ b/src/data_tools/include/data_tools/std_data.h @@ -23,6 +23,7 @@ #include #include + #define BOOST_NO_CXX11_SCOPED_ENUMS #include #include @@ -74,11 +75,14 @@ struct sss_ping_side double time_duration; double tilt_angle; double beam_width; + uint16_t initial_gain_code; + uint16_t gain_code; template void serialize( Archive & ar ) { - ar(CEREAL_NVP(pings), CEREAL_NVP(slant_range), CEREAL_NVP(time_duration), CEREAL_NVP(tilt_angle), CEREAL_NVP(beam_width)); + ar(CEREAL_NVP(pings), CEREAL_NVP(slant_range), CEREAL_NVP(time_duration), CEREAL_NVP(tilt_angle), + CEREAL_NVP(beam_width), CEREAL_NVP(initial_gain_code), CEREAL_NVP(gain_code)); } }; @@ -98,13 +102,14 @@ struct sss_ping double lat_; double long_; double sound_vel_; + double altitude_; Eigen::Vector3d pos_; // NOTE: this comes from associating ping with nav data template void serialize( Archive & ar ) { ar(CEREAL_NVP(time_string_), CEREAL_NVP(time_stamp_), CEREAL_NVP(port), CEREAL_NVP(stbd), CEREAL_NVP(first_in_file_), CEREAL_NVP(heading_), - CEREAL_NVP(pitch_), CEREAL_NVP(roll_), CEREAL_NVP(lat_), CEREAL_NVP(long_), CEREAL_NVP(sound_vel_), CEREAL_NVP(pos_)); + CEREAL_NVP(pitch_), CEREAL_NVP(roll_), CEREAL_NVP(lat_), CEREAL_NVP(long_), CEREAL_NVP(sound_vel_), CEREAL_NVP(altitude_), CEREAL_NVP(pos_)); } EIGEN_MAKE_ALIGNED_OPERATOR_NEW diff --git a/src/data_tools/src/xtf_data.cpp b/src/data_tools/src/xtf_data.cpp index 8479e1da..30ff484f 100644 --- a/src/data_tools/src/xtf_data.cpp +++ b/src/data_tools/src/xtf_data.cpp @@ -128,6 +128,7 @@ xtf_sss_ping process_side_scan_ping(XTFPINGHEADER *PingHeader, XTFFILEHEADER *XT ping.roll_ = M_PI/180.*PingHeader->SensorRoll; ping.pitch_ = M_PI/180.*PingHeader->SensorPitch; ping.sound_vel_ = PingHeader->SoundVelocity; + ping.altitude_ = PingHeader->SensorPrimaryAltitude; boost::posix_time::ptime data_time(boost::gregorian::date(PingHeader->Year, PingHeader->Month, PingHeader->Day), boost::posix_time::hours(PingHeader->Hour)+boost::posix_time::minutes(PingHeader->Minute)+boost::posix_time::seconds(PingHeader->Second)+boost::posix_time::milliseconds(10*int(PingHeader->HSeconds))); stringstream time_ss; @@ -204,6 +205,8 @@ xtf_sss_ping process_side_scan_ping(XTFPINGHEADER *PingHeader, XTFFILEHEADER *XT } ping_channel->time_duration = ChanHeader->TimeDuration; ping_channel->slant_range = ChanHeader->SlantRange; + ping_channel->gain_code = ChanHeader->GainCode; + ping_channel->initial_gain_code = ChanHeader->InitialGainCode; // Do whatever processing on the sidescan imagery here. //cout << "Processing a side scan ping!!" << endl; diff --git a/src/pydata_tools/src/pystd_data.cpp b/src/pydata_tools/src/pystd_data.cpp index ab679dd4..9763488c 100644 --- a/src/pydata_tools/src/pystd_data.cpp +++ b/src/pydata_tools/src/pystd_data.cpp @@ -67,7 +67,9 @@ PYBIND11_MODULE(std_data, m) { .def_readwrite("slant_range", &std_data::sss_ping_side::slant_range, "Slant range") .def_readwrite("time_duration", &std_data::sss_ping_side::time_duration, "Furthest measured intensity") .def_readwrite("tilt_angle", &std_data::sss_ping_side::tilt_angle, "Tilt angle") - .def_readwrite("beam_width", &std_data::sss_ping_side::beam_width, "Beam width"); + .def_readwrite("beam_width", &std_data::sss_ping_side::beam_width, "Beam width") + .def_readwrite("gain_code", &std_data::sss_ping_side::gain_code, "Gain code") + .def_readwrite("initial_gain_code", &std_data::sss_ping_side::initial_gain_code, "Initial gain code"); py::class_(m, "sss_ping", "Class for xtf sidescan type") .def(py::init<>()) @@ -82,6 +84,7 @@ PYBIND11_MODULE(std_data, m) { .def_readwrite("lat_", &std_data::sss_ping::lat_, "Latitude") .def_readwrite("long_", &std_data::sss_ping::long_, "Longitude") .def_readwrite("sound_vel_", &std_data::sss_ping::sound_vel_, "Sound speed in m/s") + .def_readwrite("altitude_", &std_data::sss_ping::altitude_, "Sensor primary altitude in m") .def_readwrite("pos_", &std_data::sss_ping::pos_, "Position in ENU coordinates") .def_static("read_data", &read_data_from_str, "Read sss_ping::PingsT from .cereal file"); diff --git a/src/pydata_tools/src/pyxtf_data.cpp b/src/pydata_tools/src/pyxtf_data.cpp index d63cc9fe..719a5bed 100644 --- a/src/pydata_tools/src/pyxtf_data.cpp +++ b/src/pydata_tools/src/pyxtf_data.cpp @@ -29,7 +29,9 @@ PYBIND11_MODULE(xtf_data, m) { .def_readwrite("slant_range", &xtf_sss_ping_side::slant_range, "Slant range") .def_readwrite("time_duration", &xtf_sss_ping_side::time_duration, "Furthest measured intensity") .def_readwrite("tilt_angle", &xtf_sss_ping_side::tilt_angle, "Tilt angle") - .def_readwrite("beam_width", &xtf_sss_ping_side::beam_width, "Beam width"); + .def_readwrite("beam_width", &xtf_sss_ping_side::beam_width, "Beam width") + .def_readwrite("gain_code", &xtf_sss_ping_side::gain_code, "Gain code") + .def_readwrite("initial_gain_code", &xtf_sss_ping_side::initial_gain_code, "Initial gain code"); py::class_(m, "xtf_sss_ping", py::module_local(), "Class for xtf sidescan type") .def(py::init<>()) @@ -44,6 +46,7 @@ PYBIND11_MODULE(xtf_data, m) { .def_readwrite("lat_", &xtf_sss_ping::lat_, "Latitude") .def_readwrite("long_", &xtf_sss_ping::long_, "Longitude") .def_readwrite("sound_vel_", &xtf_sss_ping::sound_vel_, "Sound speed in m/s") + .def_readwrite("altitude_", &xtf_sss_ping::altitude_, "Sensor primary altitude in m") .def_readwrite("pos_", &xtf_sss_ping::pos_, "Position in ENU coordinates") .def_static("parse_file", &parse_file_from_str, "Parse xtf_sss_ping from .xtf file") .def_static("parse_folder", &parse_folder_from_str, "Parse xtf_sss_ping from folder of .xtf files")