Skip to content

Commit

Permalink
Merge pull request #268 from valeriof7/feature/odf_range
Browse files Browse the repository at this point in the history
Add processing of DSN sequential range from ODF files and SPICE error handling module
  • Loading branch information
DominicDirkx authored Dec 12, 2024
2 parents 6b2efd2 + 7cd102b commit 1e71060
Show file tree
Hide file tree
Showing 23 changed files with 6,805 additions and 4,497 deletions.
32 changes: 18 additions & 14 deletions include/tudat/astro/ground_stations/transmittingFrequencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include "tudat/math/quadrature/trapezoidQuadrature.h"
#include "tudat/math/interpolators.h"
#include "tudat/astro/basic_astro/dateTime.h"

namespace tudat
{
Expand Down Expand Up @@ -200,20 +201,23 @@ class PiecewiseLinearFrequencyInterpolator: public StationFrequencyInterpolator
// If there are discontinuities
if ( startTimes_.at( i ) != endTimes_.at( i - 1 ) )
{
// If the start and end times are inconsistent throw error
if ( endTimes_.at( i - 1 ) > startTimes_.at( i ) )
{
throw std::runtime_error(
"Error when creating piecewise linear frequency interpolator: inconsistency between ramp end "
"time (" + std::to_string( double( endTimes_.at( i - 1 ) ) ) + ") and start time of the following ramp (" +
std::to_string( double( startTimes_.at( i ) ) ) + "); the end is smaller than the start time." );
}
// If there are gaps in the data save that information
else
{
invalidTimeBlocksStartTimes_.push_back( endTimes_.at( i - 1 ) );
invalidTimeBlocksEndTimes_.push_back( startTimes_.at( i ) );
}
// // If the start and end times are inconsistent throw error
// if ( endTimes_.at( i - 1 ) > startTimes_.at( i ) )
// {
// throw std::runtime_error(
// "Error when creating piecewise linear frequency interpolator: inconsistency between ramp end "
// "time (" + std::to_string( double( endTimes_.at( i - 1 ) ) ) + ";" +
// basic_astrodynamics::getCalendarDateFromTime( endTimes_.at( i - 1 ) ).isoString( ) + ") and start time of the following ramp (" +
// std::to_string( double( startTimes_.at( i ) ) ) + ";" +
// basic_astrodynamics::getCalendarDateFromTime( startTimes_.at( i ) ).isoString( ) +
// "); the end is smaller than the start time." );
// }
// // If there are gaps in the data save that information
// else
// {
// invalidTimeBlocksStartTimes_.push_back( endTimes_.at( i - 1 ) );
// invalidTimeBlocksEndTimes_.push_back( startTimes_.at( i ) );
// }
}
}

Expand Down

Large diffs are not rendered by default.

178 changes: 109 additions & 69 deletions include/tudat/astro/observation_models/dsnNWayRangeObservationModel.h

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions include/tudat/astro/observation_models/lightTimeSolution.h
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ class MultiLegLightTimeCalculator
linkEndsDelays_ = ancillarySettings->getAncilliaryDoubleVectorData(
link_ends_delays, false );
}

if ( !linkEndsDelays_.empty( ) )
{
// Delays vector already including delays at receiving and transmitting stations
Expand Down Expand Up @@ -1060,6 +1061,7 @@ class MultiLegLightTimeCalculator

// If an additional leg is required, retrieve retransmission delay and update current time
currentLightTime += linkEndsDelays_.at( currentUpIndex + 1 );

currentLinkEndTransmissionTime += currentLightTime;

// Add computed light-time to total time and move to next leg
Expand Down
36 changes: 32 additions & 4 deletions include/tudat/astro/observation_models/observationModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum ObservationAncilliarySimulationVariable {
doppler_reference_frequency,
sequential_range_reference_frequency,
sequential_range_lowest_ranging_component,
range_conversion_factor,
};

struct ObservationAncilliarySimulationSettings {
Expand All @@ -57,6 +58,7 @@ struct ObservationAncilliarySimulationSettings {
case reception_reference_frequency_band:
case sequential_range_reference_frequency:
case sequential_range_lowest_ranging_component:
case range_conversion_factor:
doubleData_[ variableType ] = variable;
break;
default:
Expand Down Expand Up @@ -97,6 +99,7 @@ struct ObservationAncilliarySimulationSettings {
case reception_reference_frequency_band:
case sequential_range_reference_frequency:
case sequential_range_lowest_ranging_component:
case range_conversion_factor:
returnVariable = doubleData_.at( variableType );
break;
default:
Expand Down Expand Up @@ -187,6 +190,9 @@ struct ObservationAncilliarySimulationSettings {
case sequential_range_lowest_ranging_component:
name = "DSN sequential range lowest ranging component";
break;
case range_conversion_factor:
name = "DSN range conversion factor from RU to meter";
break;
default:
throw std::runtime_error(
"Error when getting ancillary observation data name; "
Expand Down Expand Up @@ -293,6 +299,28 @@ getDsnNWayAveragedDopplerAncillarySettings(
return ancillarySettings;
}

inline std::shared_ptr< ObservationAncilliarySimulationSettings > getDsnNWayRangeAncillarySettings(
const std::vector< FrequencyBands > &frequencyBands,
const double referenceFrequency,
const double lowestRangingComponent,
const std::vector< double > linkEndsDelays = std::vector< double >( ) )

{
std::shared_ptr< ObservationAncilliarySimulationSettings > ancillarySettings =
std::make_shared< ObservationAncilliarySimulationSettings >( );

ancillarySettings->setAncilliaryDoubleData( sequential_range_lowest_ranging_component,
lowestRangingComponent );
ancillarySettings->setAncilliaryDoubleData( sequential_range_reference_frequency,
referenceFrequency );

ancillarySettings->setAncilliaryDoubleVectorData(
frequency_bands, convertFrequencyBandsToDoubleVector( frequencyBands ) );
ancillarySettings->setAncilliaryDoubleVectorData( link_ends_delays, linkEndsDelays );

return ancillarySettings;
}

inline std::shared_ptr< ObservationAncilliarySimulationSettings >
getDopplerMeasuredFrequencyAncilliarySettings( const std::vector< FrequencyBands > &frequencyBands )
{
Expand Down Expand Up @@ -635,10 +663,10 @@ class ObservationModel
std::vector< Eigen::Matrix< double, 6, 1 > > linkEndStates_;
};
//
//extern template class ObservationModel< 1, double, double >;
//extern template class ObservationModel< 2, double, double >;
//extern template class ObservationModel< 3, double, double >;
//extern template class ObservationModel< 6, double, double >;
// extern template class ObservationModel< 1, double, double >;
// extern template class ObservationModel< 2, double, double >;
// extern template class ObservationModel< 3, double, double >;
// extern template class ObservationModel< 6, double, double >;

//! Function to compute an observation of size 1 at double precision, with double precision input
/*!
Expand Down
Loading

0 comments on commit 1e71060

Please sign in to comment.