local globe = asset.require("../../earth")



local Name = "Polar Orbiting: NASA A-Train Satellites"
local Identifier = "noaa-sos-atmosphere-nasa_sats"
local Description = [[In order to enable coordinated science observations, the Earth
Observations System has created the A-Train. When finally completed in 2008, the A-Train
will consist of 6 polar-orbiting satellites that travel just minutes apart in a line.
Four of the satellites are NASA satellites, one is a French Centre National d'Etudes
Spatiales (CNES) satellite, and the other is a joint satellite between NASA and CNES. The
satellites have low polar orbits 438 miles (705 km) above Earth at an inclination of 98
degrees. Together, their overlapping science instruments give a comprehensive picture of
Earth weather and climate. The "A" in the A-Train is for "afternoon" because the lead
satellite, Aqua, crosses the equator at the mean local time of approximately 1:30pm. Five
of the satellites are currently in orbit, and the sixth satellite is scheduled to be
launched in 2008]]
local URL = "https://sos.noaa.gov/catalog/datasets/polar-orbiting-nasa-a-train-satellites/"

local syncedDirectory = asset.syncedResource({
  Name = Name,
  Type = "HttpSynchronization",
  Identifier = Identifier,
  Version = 1,
  UnzipFiles = true
})


local Layer = {
  Identifier = Identifier,
  Name = Name,
  Enabled = asset.enabled,
  Type = "ImageSequenceTileLayer",
  FolderPath = syncedDirectory .. "2048",
  Description = Description
}


asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globe.Earth.Identifier, "ColorLayers", Layer)
end)

asset.export(Layer)



asset.meta = {
  Name = Name,
  Version = "1.0",
  Description = Description .. "Data provided by the National Oceanic and Atmospheric Administration",
  Author = "National Oceanic and Atmospheric Administration",
  URL = URL,
  License = "https://sos.noaa.gov/copyright/"
}
