43 lines
920 B
Julia
43 lines
920 B
Julia
using Thesis
|
|
using SPICE
|
|
using LinearAlgebra
|
|
using Dates
|
|
using PlotlyJS
|
|
|
|
try
|
|
furnsh("../../spice_files/naif0012.tls")
|
|
furnsh("../../spice_files/de430.bsp")
|
|
catch
|
|
furnsh("spice_files/naif0012.tls")
|
|
furnsh("spice_files/de430.bsp")
|
|
end
|
|
|
|
function cost(m::Union{Mission, Mission_Guess})
|
|
norm_mass = (m.start_mass - prop(m)[7]) / m.start_mass
|
|
norm_C3 = ( m.launch_v∞ ⋅ m.launch_v∞ ) / 200.
|
|
return 3norm_mass + norm_C3
|
|
end
|
|
|
|
function get_id(m::Mission)
|
|
letters = "E"
|
|
for phase in m.phases letters *= phase.planet.name[1] end
|
|
letters *= " "
|
|
letters *= string(cost(m))
|
|
return letters
|
|
end
|
|
|
|
missions = Vector{Mission}()
|
|
folders = readdir("/home/connor/projects/thesis/archive/saturn", join=true)
|
|
for folder in folders
|
|
try
|
|
push!(missions, ingest(folder * "/mission"))
|
|
catch e
|
|
println("Ingestion failure")
|
|
end
|
|
end
|
|
|
|
sorted_missions = sort(missions, by=cost)
|
|
|
|
@show get_id.(sorted_missions)
|
|
|