Tudat/Astrodynamics/OrbitDetermination/ObservationPartials/angularPositionPartial.cpp
//! Function to calculate the observation partial(s) at required time and state
Function to calculate the observation partial(s) at required time and state
Function to calculate the observation partial ( s ) at required time and state
AngularPositionPartial::AngularPositionPartialReturnType AngularPositionPartial::calculatePartial(
        const std::vector< Eigen::Vector6d >& states,
        const std::vector< double >& times,
        const observation_models::LinkEndType linkEndOfFixedTime,
        const Eigen::Vector2d& currentObservation )
{
    if( linkEndOfFixedTime != angularPositionScaler_->getCurrentLinkEndType( ) )
    {
        throw std::runtime_error( "Error angular position partial and scaling are inconsistent" );
    }
    AngularPositionPartialReturnType returnPartial;
    for( positionPartialIterator_ = positionPartialList_.begin( ); positionPartialIterator_ != positionPartialList_.end( );
         positionPartialIterator_++ )
    {
        if( positionPartialIterator_->first == observation_models::transmitter )
        {
            currentState_  = states[ 0 ];
            currentTime_ = times[ 0 ];
        }
        else if( positionPartialIterator_->first == observation_models::receiver )
        {
            currentState_  = states[ 1 ];
            currentTime_ = times[ 1 ];
        }
        returnPartial.push_back(
                    std::make_pair(
                        angularPositionScaler_->getScalingFactor( positionPartialIterator_->first ) *
                        ( positionPartialIterator_->second->calculatePartialOfPosition(
                              currentState_ , currentTime_ ) ), currentTime_ ) );
    }
    for( unsigned int i = 0; i < lighTimeCorrectionPartialsFunctions_.size( ); i++ )
    {
        currentLinkTimeCorrectionPartial_ = lighTimeCorrectionPartialsFunctions_.at( i )( states, times );
        returnPartial.push_back(
                    std::make_pair( angularPositionScaler_->getLightTimePartialScalingFactor( ) *
                                    physical_constants::SPEED_OF_LIGHT * currentLinkTimeCorrectionPartial_.first,
                    currentLinkTimeCorrectionPartial_.second ) );
    }
    return returnPartial;
}
AngularPositionPartial :: AngularPositionPartialReturnType AngularPositionPartial :: calculatePartial ( const std :: vector < Eigen :: Vector6d > & states , const std :: vector < double > & times , const observation_models :: LinkEndType linkEndOfFixedTime , const Eigen :: Vector2d & currentObservation ) { if ( linkEndOfFixedTime != angularPositionScaler_ -> getCurrentLinkEndType ( ) ) { throw std :: runtime_error ( " " ) ; } AngularPositionPartialReturnType returnPartial ; for ( positionPartialIterator_ = positionPartialList_ . begin ( ) ; positionPartialIterator_ != positionPartialList_ . end ( ) ; positionPartialIterator_ ++ ) { if ( positionPartialIterator_ -> first == observation_models :: transmitter ) { currentState_ = states [ 0 ] ; currentTime_ = times [ 0 ] ; } else if ( positionPartialIterator_ -> first == observation_models :: receiver ) { currentState_ = states [ 1 ] ; currentTime_ = times [ 1 ] ; } returnPartial . push_back ( std :: make_pair ( angularPositionScaler_ -> getScalingFactor ( positionPartialIterator_ -> first ) * ( positionPartialIterator_ -> second -> calculatePartialOfPosition ( currentState_ , currentTime_ ) ) , currentTime_ ) ) ; } for ( unsigned int i = 0 ; i < lighTimeCorrectionPartialsFunctions_ . size ( ) ; i ++ ) { currentLinkTimeCorrectionPartial_ = lighTimeCorrectionPartialsFunctions_ . at ( i ) ( states , times ) ; returnPartial . push_back ( std :: make_pair ( angularPositionScaler_ -> getLightTimePartialScalingFactor ( ) * physical_constants :: SPEED_OF_LIGHT * currentLinkTimeCorrectionPartial_ . first , currentLinkTimeCorrectionPartial_ . second ) ) ; } return returnPartial ; }
Function to calculate the observation partial(s) at required time and state
Function to calculate the observation partial ( s ) at required time and state
// Iterate over all link ends // Scale position partials // Add scaled light-time correcion partials.