Skip to content

Commit

Permalink
Minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicDirkx committed Aug 1, 2024
1 parent 92e5736 commit 4e91e4e
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions estimation/mro_range_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

# In[1]:


print('Start')
# Set the filename of the data file
TRACKING_FNAME = "./data/mrorange2006-2013.txt"

Expand Down Expand Up @@ -99,7 +99,7 @@
# In[4]:

# Create ancillary settings
ancillary_settings = observation.n_way_range_ancilliary_settings(frequency_bands=[observation.FrequencyBands.x_band])
ancillary_settings = observation.n_way_range_ancilliary_settings(frequency_bands=[observation.FrequencyBands.x_band,observation.FrequencyBands.x_band])

# Create the observation collection
observations = observation.create_tracking_txtfile_observation_collection(
Expand Down Expand Up @@ -188,6 +188,7 @@ def create_bodies(use_itrf_rotation_model: bool = False) -> environment.SystemOf
# Extract the relevant information from the real observations to mimic
linkdef_ids = observations.concatenated_link_definition_ids
distinct_linkdefs = observations.get_link_definitions_for_observables(observation.n_way_range_type)
link_ends_per_index = observations.link_definition_ids

# Create the observation model settings to match those of the real observations
observation_model_settings = [
Expand Down Expand Up @@ -259,14 +260,26 @@ def create_observations(observation_model_settings, bodies):
# Create light time corrections
light_time_correction_list =[
estimation_setup.observation.first_order_relativistic_light_time_correction(["Sun"]),
estimation_setup.observation.inverse_power_series_solar_corona_light_time_correction( )
estimation_setup.observation.inverse_power_series_solar_corona_light_time_correction( [3.6E11], [2] )
]

bias_setting = estimation_setup.observation.two_way_time_scale_range_bias( )

observation_model_settings_lighttime = [
estimation_setup.observation.n_way_range(distinct_linkdefs[linkdef_id], light_time_correction_list) for linkdef_id in linkdef_ids
estimation_setup.observation.n_way_range(distinct_linkdefs[linkdef_id], light_time_correction_list,bias_setting) for linkdef_id in link_ends_per_index
]

bodies_rotation.get( 'Mars' ).system_models.set_default_transponder_turnaround_ratio_function( )

for linkdef_id in link_ends_per_index:
current_link_end = link_ends_per_index[linkdef_id]
current_station = current_link_end[observation.receiver].reference_point
bodies_rotation.get('Earth').get_ground_station( current_station ).set_transmitting_frequency_calculator( environment.ConstantFrequencyInterpolator( 7.2E9 ) )
print( current_station )

print('Pre-create', len(observation_model_settings_lighttime))
simulated_observations_lighttime = create_observations(observation_model_settings_lighttime, bodies_rotation)
print('Post-create')
residuals_lighttime = simulated_observations_lighttime.concatenated_observations - observation_vals
link_end_ids = simulated_observations_lighttime.concatenated_link_definition_ids
link_ends_per_index = simulated_observations_lighttime.link_definition_ids
Expand All @@ -281,7 +294,7 @@ def create_observations(observation_model_settings, bodies):
first_time_difference = time_scale_converter.get_time_difference( time_conversion.tdb_scale, time_conversion.tai_scale, observation_times[ i ], current_ground_station_position )
second_time_difference = time_scale_converter.get_time_difference( time_conversion.tdb_scale, time_conversion.tai_scale, observation_times[ i ] - observation_vals[ i ] / 299792458., current_ground_station_position )
corrections.append( ( second_time_difference - first_time_difference ) * 3E8 )
residuals_lighttime[ i ] = residuals_lighttime[ i ] - ( second_time_difference - first_time_difference ) * 299792458.
# residuals_lighttime[ i ] = residuals_lighttime[ i ] - ( second_time_difference - first_time_difference ) * 299792458.

# Plot the new residuals
plt.figure()
Expand Down

0 comments on commit 4e91e4e

Please sign in to comment.