local globeIdentifier = asset.require("../../venus").Venus.Identifier

local layer = {
  Identifier = "Magellan",
  Name = "Magellan Elevation [Utah]",
  Enabled = asset.enabled,
  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])]],
  FilePath = asset.localResource("magellan_utah.wms"),
  TilePixelSize = 64,
  Settings = {
    Gamma = 1.72,
    Multiplier = 1.1
  }
}

asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globeIdentifier, "HeightLayers", layer)
end)

asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globeIdentifier, "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"
}
