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



local Name = "Sea Surface Temperature Model"
local Identifier = "noaa-sos-oceans-nasa_sst"
local Description = [["Sea surface temperature plays a vital role in the behavior of
the Earth's climate and weather. It is both a causal factor and a resulting effect of
complex interactions of natural forces on Earth. NASA not only measures sea surface
temperature from space using powerful scientific instruments, but it also studies
temperature processes in advanced computer models." -Gretchen Cook-Anderson, Goddard
Space Flight Center]]
local URL = "https://sos.noaa.gov/catalog/datasets/sea-surface-temperature-model/"


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 .. "4000",
  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/"
}
