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



local Name = "Wave Heights - Hurricane Katrina 2005"
local Identifier = "noaa-sos-oceans-waves-wave_height_katrina"
local Description = [[This movie shows calculations of the NOAA wave forecasting model,
called WAVEWATCH III, over the Atlantic Ocean and focuses on the time period that
Hurricane Katrina occurred. Hurricane Katrina formed near the Bahamas on August 23rd,
2005. It made landfall in Florida on Monday August 27th and then regained energy tracking
though the Gulf of Mexico. Finally it hit the southeast Louisiana coast on Monday August
29th, 2005]]
local URL = "https://sos.noaa.gov/catalog/datasets/wave-heights-hurricane-katrina-2005/"


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 .. "4096",
  Description = Description
}

local Colorbar = {
  Identifier = Identifier,
  Name = Name,
  Enabled = asset.enabled,
  Type = "ScreenSpaceImageLocal",
  TexturePath = syncedDirectory .. "colorbar.png",
  FaceCamera = false,
  CartesianPosition = { 0.0, -0.5, -2.0 }
}


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

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

asset.export(Layer)
asset.export(Colorbar)



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