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



local Layer = {
  Identifier = "MagellanElevation_Utah",
  Name = "Magellan Elevation [Utah]",
  Enabled = asset.enabled,
  FilePath = asset.localResource("magellan_utah.wms"),
  TilePixelSize = 129,
  Settings = {
    Gamma = 1.72,
    Multiplier = 1.1
  },
  Description = [[Elevation layer for Venus. The represents the version 2 (1997 release)
    of the Global Topographic Data Record (GTDR-SINUS.3;2). The range to surface is
    derived by fitting altimeter echoes from the fan-beam altimetry antenna as a function
    of time to Hagfors' radar backscatter model templates. The ranges are subtracted from
    the spacecraft radial coordinate (derived from Doppler tracking), yielding
    measurements of planetary radius. The data are filtered to remove low-frequency errors
    in the in-plane elements of each spacecraft orbit, and then originally re-sampled into
    sinusoidal, Mercator, and north and south polar stereographic projections at a
    resolution of 5 kilometers per pixel (4641 meters per pixel [m])]]
}


asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globe.Venus.Identifier, "HeightLayers", Layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globe.Venus.Identifier, "HeightLayers", Layer)
end)

asset.export("layer", Layer)



asset.meta = {
  Name = "Venus Magellan DEM",
  Version = "1.0",
  Description = [[Map layer for Venus containting Venus Magellan DEM from the USGS.
    Hosted on the OpenSpace servers in Utah]],
  Author = "USGS",
  URL = "https://astrogeology.usgs.gov/search/map/Venus/Magellan/RadarProperties" ..
    "/Venus_Magellan_Topography_Global_4641m_v02",
  License = "NASA/PDS"
}
