Skip to content

Commit

Permalink
minor warning fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFayolle committed Oct 25, 2024
1 parent 725c19b commit 26f2c14
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions include/tudat/simulation/estimation_setup/observations.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class SingleObservationSet
return computedObservationsVector;
}

int getNumberOfFilteredObservations( ) const
unsigned int getNumberOfFilteredObservations( ) const
{
int numberFilteredObservations = 0;
if ( filteredObservationSet_ != nullptr )
Expand Down Expand Up @@ -661,12 +661,12 @@ class SingleObservationSet
residualCutOff = std::dynamic_pointer_cast< ObservationFilter< Eigen::VectorXd > >( observationFilter )->getFilterValue( );
}

for ( int j = 0 ; j < nbObservationsToTest ; j++ )
for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ )
{
Eigen::Matrix< ObservationScalarType, Eigen::Dynamic, 1 > singleObservationResidual =
( observationFilter->filterOut( ) ? residuals_.at( j ) : filteredObservationSet_->getResidual( j ) );
bool removeObservation = false;
for( int k = 0 ; k < singleObservationSize_ ; k++ )
for( unsigned int k = 0 ; k < singleObservationSize_ ; k++ )
{
if( ( !useOppositeCondition && ( std::fabs( singleObservationResidual[ k ] ) > residualCutOff[ k ] ) ) ||
( useOppositeCondition && ( std::fabs( singleObservationResidual[ k ] ) <= residualCutOff[ k ] ) ) )
Expand Down Expand Up @@ -697,12 +697,12 @@ class SingleObservationSet
absoluteValueCutOff = std::dynamic_pointer_cast< ObservationFilter< Eigen::VectorXd > >( observationFilter )->getFilterValue( );
}

for ( int j = 0 ; j < nbObservationsToTest ; j++ )
for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ )
{
Eigen::Matrix< ObservationScalarType, Eigen::Dynamic, 1 > singleObservation =
( observationFilter->filterOut( ) ? observations_.at( j ) : filteredObservationSet_->getObservation( j ) );
bool removeObservation = false;
for( int k = 0 ; k < singleObservationSize_ ; k++ )
for( unsigned int k = 0 ; k < singleObservationSize_ ; k++ )
{
if ( ( !useOppositeCondition && ( singleObservation[ k ] > absoluteValueCutOff[ k ] ) ) ||
( useOppositeCondition && ( singleObservation[ k ] <= absoluteValueCutOff[ k ] ) ) )
Expand All @@ -720,7 +720,7 @@ class SingleObservationSet
case epochs_filtering:
{
std::vector< double > filterEpochs = std::dynamic_pointer_cast< ObservationFilter< std::vector< double > > >( observationFilter )->getFilterValue( );
for ( int j = 0 ; j < nbObservationsToTest ; j++ )
for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ )
{
TimeType singleObservationTime = ( observationFilter->filterOut( ) ? observationTimes_.at( j ) : filteredObservationSet_->getObservationTime( j ) );
if ( ( !useOppositeCondition && ( std::count( filterEpochs.begin( ), filterEpochs.end( ), singleObservationTime ) > 0 ) ) ||
Expand All @@ -734,7 +734,7 @@ class SingleObservationSet
case time_bounds_filtering:
{
std::pair< double, double > timeBounds = std::dynamic_pointer_cast< ObservationFilter< std::pair< double, double > > >( observationFilter )->getFilterValue( );
for ( int j = 0 ; j < nbObservationsToTest ; j++ )
for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ )
{
TimeType singleObservationTime = ( observationFilter->filterOut( ) ? observationTimes_.at( j ) : filteredObservationSet_->getObservationTime( j ) );
if ( ( !useOppositeCondition && ( ( singleObservationTime >= timeBounds.first ) && ( singleObservationTime <= timeBounds.second ) ) ) ||
Expand Down Expand Up @@ -774,10 +774,10 @@ class SingleObservationSet
}

// Check dependent variable values against cut-off value
for ( int j = 0 ; j < nbObservationsToTest ; j++ )
for ( unsigned int j = 0 ; j < nbObservationsToTest ; j++ )
{
bool removeObservation = false;
for( int k = 0 ; k < dependentVariableSize ; k++ )
for( unsigned int k = 0 ; k < dependentVariableSize ; k++ )
{
if( ( !useOppositeCondition && ( singleDependentVariableValues( j, k ) ) > dependentVariableCutOff[ k ] ) ||
( useOppositeCondition && ( singleDependentVariableValues( j, k ) ) <= dependentVariableCutOff[ k ] ) )
Expand Down Expand Up @@ -1130,7 +1130,7 @@ std::vector< std::shared_ptr< SingleObservationSet< ObservationScalarType, TimeT
{
bool detectedStartSet = false;
int indexObs = rawStartIndicesNewSets.at( rawStartIndicesNewSets.size( ) - 1 );
while ( !detectedStartSet && indexObs < observationTimes.size( ) )
while ( !detectedStartSet && indexObs < static_cast< int >( observationTimes.size( ) ) )
{
if ( observationTimes.at( indexObs ) > currentTimeTag )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,8 +745,8 @@ BOOST_AUTO_TEST_CASE( test_ObservationsFiltering )
Eigen::Matrix< double, Eigen::Dynamic, 1 > residualsStation2 = ( residualCutOffValue - 0.05 ) * Eigen::Matrix< double, Eigen::Dynamic, 1 >::Ones( nbRangeStation2, 1 );
unsigned int nbRangeStation3 = rangeObservationSets.at( 2 )->getNumberOfObservables( );
Eigen::Matrix< double, Eigen::Dynamic, 1 > residualsStation3 = ( residualCutOffValue - 0.05 ) * Eigen::Matrix< double, Eigen::Dynamic, 1 >::Ones( nbRangeStation3, 1 );
int nbLargeResidualsStation3 = 0;
for ( int i = 0 ; i < nbRangeStation3 ; i++ )
unsigned int nbLargeResidualsStation3 = 0;
for ( unsigned int i = 0 ; i < nbRangeStation3 ; i++ )
{
if ( i%2 )
{
Expand Down Expand Up @@ -845,7 +845,7 @@ BOOST_AUTO_TEST_CASE( test_ObservationsSplitting )


// Test splitting based on time tags
int indexSplitEpoch = int(numberOfObservations/3);
unsigned int indexSplitEpoch = static_cast< unsigned int >(numberOfObservations/3);
std::vector< double > rangeObsTimes = baseTimeList.at( one_way_range );
double splitEpoch = rangeObsTimes.at( indexSplitEpoch );
std::vector< double > timeTags = { rangeObsTimes.at( 0 ), splitEpoch, rangeObsTimes.back( ) };
Expand Down
6 changes: 3 additions & 3 deletions tests/src/io/unitTestTrackingTxtFileReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,13 @@ std::map<std::string, Eigen::Vector3d> stationPositionMap = getVlbiStationPositi
std::cout<<stationPositionMap.at("HOBART12");
std::map<std::string, Eigen::Vector3d> stationPositionMap2 = getVlbiStationPositions( );
std::cout<<stationPositionMap2.at("HOBART12");
Eigen::Vector3d hobartPos = stationPosMap.at("HOBART12");
Eigen::Vector3d hobartVel = stationVelMap.at("HOBART12");
// Eigen::Vector3d hobartPos = stationPosMap.at("HOBART12");
// Eigen::Vector3d hobartVel = stationVelMap.at("HOBART12");
// Eigen::Vector3d hobartPos = simulation_setup::getApproximateGroundStationPositionFromFile("HOBART12");
// Eigen::Vector3d hobartVel = simulation_setup::getApproximateGroundStationVelocityFromFile("HOBART12");

// BOOST_TEST(hobartPos == stationPosMap["HOBART12"], boost::test_tools::per_element());
// BOOST_TEST(hobartPos == Eigen::Vector3d(-3949990.106, 2522421.118, -4311708.734), boost::test_tools::per_element());
// BOOST_TESTfirstBlockMinMaxResidual(hobartPos == Eigen::Vector3d(-3949990.106, 2522421.118, -4311708.734), boost::test_tools::per_element());
// BOOST_TEST(hobartVel == Eigen::Vector3d(-39.90, 9.00, 39.90), boost::test_tools::per_element());
}

Expand Down

0 comments on commit 26f2c14

Please sign in to comment.