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



local Layer = {
  Identifier = "HiRISE-PSP",
  Name = "HiRISE",
  Enabled = asset.enabled,
  FilePath = asset.localResource("hirise.vrt"),
  BlendMode = "Color",
  Settings = {
    Gamma = 1.0,
    Multiplier = 1.0
  },
  Description = [[This layer is an equatorial uncontrolled composite mosaic of the
    HiRISE imagery, using all available red band images released through 2018. The
    HiRISE instrument, operated by the University of Arizona, is on board NASA's
    2005 Mars Reconnaissance Orbiter (MRO). While the resolution of the imagery is
    very high, the imagery is somewhat limited in spatial extent, covering only about
    3% of the plant's surface. The images in this layer are spatially located using
    only the initial spacecraft pointing information.  All source images used in the
    construction of this layer were produced by the team at the University of Arizona.
    This tiled web service, as hosted by Esri, is made available using lossy Jpeg
    compression using an 8 bit data range, using a linear stretch from the original
    10 bit range. (Description from URL)]]
}


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

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

asset.export("layer", Layer)



asset.meta = {
  Name = "HiRISE",
  Version = "1.1",
  Description = [[Updated HiRISE layer for Mars with raw unselected imagery. This map is
    hosted by ESRI]],
  Author = "esri_astro",
  URL = "https://www.arcgis.com/home/item.html?id=c1c4c750a2154842ae523c984cc14fa5",
  License = "Esri Master License Agreement"
}
