local transforms = asset.require("scene/solarsystem/sun/transforms")
local kernels = asset.require("./kernels").PlutoKernels
asset.require("spice/base")



local AU = 1.496e+8


local PlutoKeplerianTrail = {
  Identifier = "PlutoKeplerianTrail",
  Parent = transforms.SunECLIPJ2000.Identifier,
  Renderable = {
    Type = "RenderableTrailOrbit",
    Translation = {
      Type = "KeplerTranslation",
      Eccentricity = 0.2543033082909471,
      SemiMajorAxis = 39.74407237841206 * AU,
      Inclination = 17.36609481151430,
      AscendingNode = 110.2099981996057,
      ArgumentOfPeriapsis = 114.2248569189779,
      MeanAnomaly = 14.53,
      Epoch = "2000 01 01 00:00",
      Period = 7824380000
    },
    Color = { 0.2, 0.8, 0.3 },
    Period = 90487.27692706819,
    Resolution = 1000,
    Enabled = false
  },
  GUI = {
    Name = "Pluto Keplerian Trail",
    Path = "/Solar System/Dwarf Planets/Pluto",
    Description = "Keplerian trail of Pluto. Contains full orbit"
  }
}


asset.onInitialize(function()
  openspace.addSceneGraphNode(PlutoKeplerianTrail)
end)

asset.onDeinitialize(function()
  openspace.removeSceneGraphNode(PlutoKeplerianTrail)
end)

asset.export(PlutoKeplerianTrail)



asset.meta = {
  Name = "Pluto Keplerian Trail",
  Version = "1.0",
  Description = [[Full Keplerian trail of Pluto as observed by the Sun. Data from
    JPL Horizons]],
  Author = "OpenSpace Team",
  URL = "https://ssd.jpl.nasa.gov/sbdb.cgi?sstr=pluto",
  License = "JPL/NASA"
}
