local globeIdentifier = asset.require("scene/solarsystem//planets/mars/mars").Mars.Identifier

local layer = {
  Identifier = "CLH_Visible_Mosaic_HiRISE_CTX_HRSC_GCS_MARS_07-10-2018",
  Name = [[MRO HiRISE, Mosaic Columbia Hills]],
  FilePath = asset.localResource("CLH_Visible_Mosaic_HiRISE_CTX_HRSC_GCS_MARS_07-10-2018.vrt"),
  Description = [[Preliminary visible orthoimage mosaic for Columbia Hills candidate landing site for the Mars 2020 rover.
HRSC orthoimages and DEMs were downloaded from the Planetary Data System archives. HiRISE and CTX orthoimages and DEMs were created by the USGS Astrogeology and HiRISE teams,
and compiled and georeferenced at JPL/Caltech by the Advanced Laboratory for Landing Site Terrain Analysis and Reconnaissance (ALLSTAR) group including Nathan Williams, 
Heather Lethcoe-Wilson, Lauren Berger, Marshall Trautman, and Matt Golombek for the M2020 Council of Terrains. These files are for discussion and planning purposes 
only.
Processing Notes:
Georeferencing: 
HRSC orthos are well-coregistered to the community-standard MOLA global topography products, and CTX orthos are well-coregistered to the HRSC orthos.
Tie points were recorded at small craters visible in both HiRISE and CTX images, and a first-order transformation was used to rectify the HiRISE.

Projection and Coordinate System:
Former mosaic basemaps for M2020 used a Mars equirectangular projection with a standard parallel of 0 (also called Plate Carree),
but this caused a ~5% latitude vs longitude distortion at the remaining 3 candidate landing sites such that true circles would appear elliptical.
In this new version of basemaps, we use a Mars equirectangular projection with customized standard parallels for each site to reduce distortion to <1%.
Specifically, Columbia Hills uses a standard parallel of -14.5 degrees, while Jezero and NE Syrtis both have a standard parallel of +18 degrees. Projection (.prj) files are included with this delivery.
When analyzing images, please ensure that the correct projection system is being used. For example, there is a known issue with Matlab where reading images in as a geotiff may automatically assign an 
incorrect projection without the specified standard parallel, which then produces distorted linear (in meters) x/y values.]]
}
  
asset.onInitialize(function()
  openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
end)
  
asset.onDeinitialize(function()
  openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer.Identifier)
end)
  
asset.export("layer", layer)


asset.meta = {
  Name = [[MRO HiRISE, Mosaic Columbia Hills]],
  Version = "1.0",
  Author = "NASA/Treks",
  URL = "https://trek.nasa.gov/mars/#v=0.1&x=0&y=0&z=1&p=urn:ogc:def:crs:EPSG::104905&d=&l=CLH_Visible_Mosaic_HiRISE_CTX_HRSC_GCS_MARS_07-10-2018%2Ctrue%2C1&b=mars&e=-180.0%2C-90.0%2C180.0%2C90.0&sfv=&w=",
  License = "NASA/Treks",
  Description = [[MRO HiRISE, Mosaic Columbia Hills layer from NASA/Treks for Mars]]
}
