diff --git a/test/TPM_Didymos.jl b/test/TPM_Didymos.jl index 1ca4d814..8664d2ac 100644 --- a/test/TPM_Didymos.jl +++ b/test/TPM_Didymos.jl @@ -51,7 +51,9 @@ et_begin = SPICE.utc2et("2027-02-18T00:00:00") # Start time of TPM et_end = et_begin + 2P₂ # End time of TPM - step = P₂ / 72 # Time step of TPM + + nsteps_in_rotation = 72 # Number of steps in one rotation period + step = P₂ / nsteps_in_rotation # Time step of TPM et_range = et_begin : step : et_end """ @@ -149,15 +151,14 @@ AsteroidThermoPhysicalModels.init_temperature!(btpm, 200.) ##= Run TPM =## - time_begin = ephem.time[end] - P₂ # Time to start storing temperature - time_end = ephem.time[end] # Time to end storing temperature - face_ID_pri = [1, 2, 3, 4, 10] # Face indices at which you want to save underground temperature for the primary - face_ID_sec = [1, 2, 3, 4, 20] # Face indices at which you want to save underground temperature for the secondary + times_to_save = ephem.time[end-nsteps_in_rotation:end] # Save temperature during the final rotation + face_ID_pri = [1, 2, 3, 4, 10] # Face indices to save subsurface temperature of the primary + face_ID_sec = [1, 2, 3, 4, 20] # Face indices to save subsurface temperature of the secondary - result = AsteroidThermoPhysicalModels.run_TPM!(btpm, ephem, time_begin, time_end, face_ID_pri, face_ID_sec) + result = AsteroidThermoPhysicalModels.run_TPM!(btpm, ephem, times_to_save, face_ID_pri, face_ID_sec) ##= Save TPM result =## savedir = "TPM_Didymos" mkpath(savedir) - AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, btpm, ephem) + AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, btpm, ephem, times_to_save) end diff --git a/test/TPM_Ryugu.jl b/test/TPM_Ryugu.jl index e7d9fdea..4b75aa25 100644 --- a/test/TPM_Ryugu.jl +++ b/test/TPM_Ryugu.jl @@ -39,10 +39,12 @@ end ##= Ephemerides =## - P = SPICE.convrt(7.63262, "hours", "seconds") # Rotation period of Ryugu - et_begin = SPICE.utc2et("2018-07-01T00:00:00") # Start time of TPM - et_end = et_begin + 2P # End time of TPM - step = P / 360 # Time step of TPM, corresponding to 1 deg rotation + P = SPICE.convrt(7.63262, "hours", "seconds") # Rotation period of Ryugu + et_begin = SPICE.utc2et("2018-07-01T00:00:00") # Start time of TPM + et_end = et_begin + 2P # End time of TPM + + nsteps_in_rotation = 72 # Number of steps in one rotation period + step = P / nsteps_in_rotation # Time step of TPM et_range = et_begin : step : et_end """ @@ -100,14 +102,13 @@ AsteroidThermoPhysicalModels.init_temperature!(stpm, 200) ##= Run TPM =## - time_begin = ephem.time[end] - P # Time to start storing temperature - time_end = ephem.time[end] # Time to end storing temperature - face_ID = [1, 2, 3, 4, 10] # Face indices at which you want to save underground temperature + times_to_save = ephem.time[end-nsteps_in_rotation:end] # Save temperature during the final rotation + face_ID = [1, 2, 3, 4, 10] # Face indices to save subsurface temperature - result = AsteroidThermoPhysicalModels.run_TPM!(stpm, ephem, time_begin, time_end, face_ID) + result = AsteroidThermoPhysicalModels.run_TPM!(stpm, ephem, times_to_save, face_ID) ##= Save TPM result =## savedir = "TPM_Ryugu" mkpath(savedir) - AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, stpm, ephem) + AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, stpm, ephem, times_to_save) end diff --git a/test/non-uniform_thermoparams.jl b/test/non-uniform_thermoparams.jl index e5ff30d0..fd6e4b72 100644 --- a/test/non-uniform_thermoparams.jl +++ b/test/non-uniform_thermoparams.jl @@ -41,10 +41,12 @@ end ##= Ephemerides =## - P = SPICE.convrt(7.63262, "hours", "seconds") # Rotation period of Ryugu - et_begin = SPICE.utc2et("2018-07-01T00:00:00") # Start time of TPM - et_end = et_begin + 2P # End time of TPM - step = P / 360 # Time step of TPM, corresponding to 1 deg rotation + P = SPICE.convrt(7.63262, "hours", "seconds") # Rotation period of Ryugu + et_begin = SPICE.utc2et("2018-07-01T00:00:00") # Start time of TPM + et_end = et_begin + 2P # End time of TPM + + nsteps_in_rotation = 120 # Number of steps in one rotation period + step = P / nsteps_in_rotation # Time step of TPM et_range = et_begin : step : et_end """ @@ -113,14 +115,13 @@ AsteroidThermoPhysicalModels.init_temperature!(stpm, 200) ##= Run TPM =## - time_begin = ephem.time[end] - P # Time to start storing temperature - time_end = ephem.time[end] # Time to end storing temperature - face_ID = [1, 2, 3, 4, 10] # Face indices at which you want to save underground temperature + times_to_save = ephem.time[end-nsteps_in_rotation:end] # Save temperature during the final rotation + face_ID = [1, 2, 3, 4, 10] # Face indices to save subsurface temperature - result = AsteroidThermoPhysicalModels.run_TPM!(stpm, ephem, time_begin, time_end, face_ID) + result = AsteroidThermoPhysicalModels.run_TPM!(stpm, ephem, times_to_save, face_ID) ##= Save TPM result =##' savedir = "non-uniform_thermoparams" mkpath(savedir) - AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, stpm, ephem) + AsteroidThermoPhysicalModels.export_TPM_results(savedir, result, stpm, ephem, times_to_save) end