diff --git a/include/tudat/astro/observation_models/oneWayDopplerObservationModel.h b/include/tudat/astro/observation_models/oneWayDopplerObservationModel.h index f62c7b7b7..befda707c 100644 --- a/include/tudat/astro/observation_models/oneWayDopplerObservationModel.h +++ b/include/tudat/astro/observation_models/oneWayDopplerObservationModel.h @@ -286,13 +286,13 @@ class DirectFirstOrderDopplerProperTimeRateInterface: const std::function< double( ) > gravitationalParameterFunction, const std::string& referenceBody, const LinkEndType referencePointLinkEndType = unidentified_link_end, - const std::function< Eigen::Vector6d( const double ) > referencePointStateFunction = - std::function< Eigen::Vector6d( const double ) >( ) ): + const std::vector< std::function< Eigen::Vector6d( const double ) > > referencePointStateFunction = + std::vector< std::function< Eigen::Vector6d( const double ) > >( ) ): DopplerProperTimeRateInterface( computationPointLinkEndType ), gravitationalParameterFunction_( gravitationalParameterFunction ), referenceBody_( referenceBody ), referencePointLinkEndType_( referencePointLinkEndType ), - referencePointStateFunction_( referencePointStateFunction ) + referencePointStateFunctions_( referencePointStateFunctions ) { // Check input consistency if( this->computationPointLinkEndType_ == referencePointLinkEndType ) diff --git a/include/tudat/simulation/estimation_setup/createObservationModel.h b/include/tudat/simulation/estimation_setup/createObservationModel.h index 35266ca11..14231fc9f 100644 --- a/include/tudat/simulation/estimation_setup/createObservationModel.h +++ b/include/tudat/simulation/estimation_setup/createObservationModel.h @@ -613,9 +613,14 @@ class DirectFirstOrderDopplerProperTimeRateSettings: public DopplerProperTimeRat * and w.r.t. which the velocity of the point at which proper time rate is computed is taken */ DirectFirstOrderDopplerProperTimeRateSettings( - const std::string centralBodyName ): + const std::string& centralBodyName ): DopplerProperTimeRateSettings( direct_first_order_doppler_proper_time_rate ), - centralBodyName_( centralBodyName ){ } + centralBodyNames_( { centralBodyName } ){ } + + DirectFirstOrderDopplerProperTimeRateSettings( + const std::vector< std::string >& centralBodyNames ): + DopplerProperTimeRateSettings( direct_first_order_doppler_proper_time_rate ), + centralBodyNames_( centralBodyNames ){ } //! Destructor. ~DirectFirstOrderDopplerProperTimeRateSettings( ){ } @@ -625,7 +630,7 @@ class DirectFirstOrderDopplerProperTimeRateSettings: public DopplerProperTimeRat * Name of central body, fromw which the mass monopole is retrieved to compute the proper time rate, * and w.r.t. which the velocity of the point at which proper time rate is computed is taken */ - std::string centralBodyName_; + std::vector< std::string > centralBodyNames_; }; //! Class to define the settings for one-way Doppler observable @@ -1282,6 +1287,8 @@ std::shared_ptr< DopplerProperTimeRateInterface > createOneWayDopplerProperTimeC } else { + std::vector< std::function< double( ) > > gravitationalParameterFunctions; + if( bodies.at( directFirstOrderDopplerProperTimeRateSettings->centralBodyName_ )->getGravityFieldModel( ) == nullptr ) { throw std::runtime_error( "Error when making DirectFirstOrderDopplerProperTimeRateInterface, no gravity field found for " + @@ -2291,11 +2298,11 @@ class ObservationModelCreator< 1, ObservationScalarType, TimeType > { auto uplinkOneWaySettings = std::make_shared< OneWayDopplerObservationSettings >( getUplinkFromTwoWayLinkEnds( linkEnds ), observationSettings->lightTimeCorrectionsList_, - std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Earth" ), nullptr ); + std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Sun" ), std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Sun" ) ); uplinkOneWaySettings->normalizeWithSpeedOfLight_ = false; auto downlinkOneWaySettings = std::make_shared< OneWayDopplerObservationSettings >( getDownlinkFromTwoWayLinkEnds( linkEnds ), observationSettings->lightTimeCorrectionsList_, - nullptr, std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Earth" ) ); + std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Sun" ), std::make_shared< DirectFirstOrderDopplerProperTimeRateSettings >( "Sun" ) ); downlinkOneWaySettings->normalizeWithSpeedOfLight_ = false; auto twoWaySettings = std::make_shared< TwoWayDopplerObservationSettings >( uplinkOneWaySettings, downlinkOneWaySettings ); diff --git a/tests/src/astro/observation_models/unitTestDopplerMeasuredFrequencyObservationModel.cpp b/tests/src/astro/observation_models/unitTestDopplerMeasuredFrequencyObservationModel.cpp index 768736ac8..5e8350c1b 100644 --- a/tests/src/astro/observation_models/unitTestDopplerMeasuredFrequencyObservationModel.cpp +++ b/tests/src/astro/observation_models/unitTestDopplerMeasuredFrequencyObservationModel.cpp @@ -198,9 +198,9 @@ BOOST_AUTO_TEST_CASE(testJuiceMeasuredFrequency) // std::cout<( observationTimes ) ), "pride_times.dat", 16 ); + input_output::writeMatrixToFile( observableVector, "pride_doppler.dat", 16 ); + input_output::writeMatrixToFile( residualVector, "pride_residual.dat", 16 ); + input_output::writeMatrixToFile( utilities::convertStlVectorToEigenVector( utilities::staticCastVector< double, Time >( observationTimes ) ), "pride_times.dat", 16 ); } }