Skip to content

Commit

Permalink
Update test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
MasanoriKanamaru committed Nov 21, 2023
1 parent c43b907 commit c5d62c3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 25 deletions.
15 changes: 8 additions & 7 deletions test/TPM_Didymos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down Expand Up @@ -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
19 changes: 10 additions & 9 deletions test/TPM_Ryugu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down Expand Up @@ -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
19 changes: 10 additions & 9 deletions test/non-uniform_thermoparams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down Expand Up @@ -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

0 comments on commit c5d62c3

Please sign in to comment.