Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Aug 22, 2023
2 parents 7afafe8 + f678161 commit c27fa63
Show file tree
Hide file tree
Showing 4 changed files with 251 additions and 19 deletions.
36 changes: 36 additions & 0 deletions tudatpy/kernel/expose_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@

#include "tudat/io/readHistoryFromFile.h"
#include "tudat/io/missileDatcomData.h"
#include "tudat/io/solarActivityData.h"
#include "tudat/io/readOdfFile.h"
#include "tudat/io/readTabulatedWeatherData.h"

#include <pybind11/stl.h>

namespace py = pybind11;
namespace tio = tudat::input_output;

namespace tudatpy {

Expand Down Expand Up @@ -145,6 +149,38 @@ void expose_io(py::module &m) {
.value("clb", tudat::input_output::MissileDatcomData::StaticCoefficientNames::clb, get_docstring("StaticCoefficientNames.clb").c_str())
.export_values();

py::class_<
tio::solar_activity::SolarActivityData,
std::shared_ptr< tio::solar_activity::SolarActivityData > >(
m, "SolarActivityData", get_docstring("SolarActivityData").c_str() );

py::class_<
tio::OdfRawFileContents,
std::shared_ptr< tio::OdfRawFileContents > >(
m, "OdfRawFileContents", get_docstring("OdfRawFileContents").c_str( ) )
.def("write_to_text_file",
&tio::OdfRawFileContents::writeOdfToTextFile,
py::arg("output_file"),
get_docstring("OdfRawFileContents.write_to_text_file").c_str() );

m.def("read_odf_file",
&tio::readOdfFile,
py::arg( "file_name" ),
get_docstring("read_odf_file").c_str() );

m.def("set_dsn_weather_data_in_ground_stations",
py::overload_cast<
tudat::simulation_setup::SystemOfBodies&,
const std::vector< std::string >&,
std::shared_ptr< tudat::interpolators::InterpolatorSettings >,
const std::map< int, std::vector< std::string > >&,
const std::string& >( &tio::setDsnWeatherDataInGroundStations ),
py::arg( "bodies" ),
py::arg( "weather_file_names" ),
py::arg( "interpolator_settings" ) = tudat::interpolators::linearInterpolation( ),
py::arg( "ground_stations_per_complex" ) = tudat::simulation_setup::getDefaultDsnStationNamesPerComplex( ),
py::arg( "body_with_ground_stations_name" ) = "Earth",
get_docstring("set_dsn_weather_data_in_ground_stations").c_str() );
};

}// namespace io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ namespace environment_setup {

m.def("create_ground_station_ephemeris",
py::overload_cast< const std::shared_ptr< tss::Body >, const std::string& >(
&tss::createReferencePointEphemeris<double, TIME_TYPE > ),
&tss::createReferencePointEphemeris< TIME_TYPE, double > ),
py::arg("body"),
py::arg("station_name") );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ void expose_estimation(py::module &m) {
get_docstring("ObservationCollection.observation_vector_size").c_str() )
.def_property_readonly("sorted_observation_sets", &tom::ObservationCollection<double, TIME_TYPE>::getSortedObservationSets,
get_docstring("ObservationCollection.sorted_observation_sets").c_str() )
.def_property_readonly("link_ends_per_observable_type", &tom::ObservationCollection<double, TIME_TYPE>::getLinkEndsPerObservableType,
get_docstring("ObservationCollection.link_ends_per_observable_type").c_str() )
.def("get_single_link_and_type_observations", &tom::ObservationCollection<double, TIME_TYPE>::getSingleLinkAndTypeObservationSets,
py::arg( "observable_type" ),
py::arg( "link_definition" ),
Expand Down Expand Up @@ -635,7 +637,10 @@ void expose_estimation(py::module &m) {
get_docstring("EstimationOutput.simulation_results_per_iteration").c_str() )
.def_readonly("final_residuals",
&tss::EstimationOutput<double, TIME_TYPE>::residuals_,
get_docstring("EstimationOutput.final_residuals").c_str() );
get_docstring("EstimationOutput.final_residuals").c_str() )
.def_readonly("best_iteration",
&tss::EstimationOutput<double, TIME_TYPE>::bestIteration_,
get_docstring("EstimationOutput.best_iteration").c_str() );

m.attr("PodOutput") = m.attr("EstimationOutput");

Expand Down
Loading

0 comments on commit c27fa63

Please sign in to comment.