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



local Name = "Sea Surface Temperature Observations - 2002 - 2006"
local Identifier = "noaa-sos-oceans-modis_sst"
local Description = [[Sea surface temperature, much like the atmosphere's temperature,
is constantly changing. The interaction between the ocean and the atmosphere is one that
scientists are constantly researching, especially in light of climate change. Water warms
up and cools down at a slower rate than air, so diurnal variations (heating during the
day and cooling during the night) seen in the atmosphere are hard to observe in the
ocean. The seasons, however, can be seen as the warmest water near the equator expands
toward the United States during the summer months and withdraws again during the winter
months]]
local URL = "https://sos.noaa.gov/catalog/datasets/sea-surface-temperature-observations-2002-2006/"


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/"
}
