{
 "projection": "south polar stereographic, MOON_ME/DE421, sphere R=1737400 m",
 "site_xy_m": [
  -2740.0,
  -6300.0
 ],
 "site_latlon": [
  -89.7734,
  203.505
 ],
 "edition": 2,
 "made_by": "tools/dem/dem2web2.py",
 "decode": "h = z0 + (R*256 + G) * step   (metres above the 1737400 m sphere; R is the high byte, G the low, B unused)",
 "sources": {
  "near": "LROC NAC DTM NAC_DTM_ESALL_SR12 (2 m, DLR) under 150 m wavelength on PGDA Site04 LOLA 5 m; Site04 fills NAC gaps",
  "mid": "as near where the NAC DTM reaches, else PGDA Site04 LOLA 5 m; area averaged",
  "far": "PGDA Site04 inside its 16 km tile, PGDA 87 to 90 S LOLA 5 m mosaic (product 81) beyond; area averaged",
  "horizon": "merged 2 m to 2.5 km, Site04 to 16 km, PGDA LDEM_80S_20MPP_ADJ beyond, to the product edge; 3D on the sphere"
 },
 "rings": [
  {
   "file": "near.png",
   "box_m": 2048.0,
   "px": 512,
   "z0": 1198.0,
   "step": 0.25
  },
  {
   "file": "mid.png",
   "box_m": 8192.0,
   "px": 512,
   "z0": -740.0,
   "step": 0.25
  },
  {
   "file": "far.png",
   "box_m": 76000.0,
   "px": 512,
   "z0": -3980.0,
   "step": 0.5
  }
 ],
 "horizon": {
  "file": "horizon.png",
  "n": 1440,
  "unit": "deg = (R*256+G)/100 - 90   (R high byte, G low byte, B unused, as tour.js reads it)",
  "eye_m": 1.65,
  "min": -2.553899194108832,
  "max": 1.0893372131065115,
  "reach_km": [
   296.9,
   319.98
  ]
 },
 "horizon_far": {
  "file": "horizon_far.png",
  "n": 1440,
  "beyond_m": 36000.0,
  "min": -3.7237110375074933,
  "max": -0.5389237477505279,
  "use": "per bearing, max(browser march over the tiles to 37 km, this table); index k is DEM azimuth k/4 deg from local north toward east, scene bearing = DEM azimuth + DEM.rot"
 },
 "horizon_map_far": {
  "file": "horizon_map_far.png",
  "cells": 384,
  "bins": 16,
  "warp_L_m": 38000.0,
  "origin_xy_m": [
   -2762.0,
   -6238.0
  ],
  "made_by": "tools/dem/farhor.py",
  "encoding": "ts8",
  "points_a_cell": 16,
  "layout": "grey 4M x 6M; rows 0..4M-1 T: bearing b (scene azimuth b*pi/8 from +x toward +z) at column block b & 3, row block b >> 2, M x M; rows 4M..6M-1 S at half the cells: bearing b at column block b & 3, row block b >> 2, M/2 x M/2 (each the mean of 2 x 2 cells); row j = z cell, column i = x cell",
  "warp": "u = 0.5 + 0.5 * sign(p) * sqrt(min(|p| / L, 1)) per axis, p the scene x or z in metres",
  "decode": "T: c <= 219: c / 1000 - 0.06; c > 219: 0.159 + (c - 219) * 0.0175 (the mean over the cell of the horizon tangent); S = (c / 255)^2 * 0.42 (its standard deviation over the cell)",
  "shade": "lit share = smoothstep(T - w, T + w, tan(sun elevation)), w = max(0.0065, 1.7 S)"
 },
 "farterrain": {
  "file": "farterrain.png",
  "bearings": 1440,
  "spans": 40,
  "edges_m": [
   36000.0,
   37927.6,
   39958.3,
   42097.8,
   44351.9,
   46726.6,
   49228.5,
   51864.4,
   54641.4,
   57567.1,
   60649.4,
   63896.7,
   67318.0,
   70922.4,
   74719.8,
   78720.6,
   82935.5,
   87376.2,
   92054.6,
   96983.5,
   102176.3,
   107647.2,
   113411.0,
   119483.4,
   125880.9,
   132621.0,
   139721.9,
   147203.1,
   155084.8,
   163388.6,
   172137.0,
   181353.7,
   191064.0,
   201294.2,
   212072.2,
   223427.2,
   235390.2,
   247993.8,
   261272.2,
   275261.6,
   290000.0
  ],
  "eye_m": 1.65,
  "origin_xy_m": [
   -2762.0,
   -6238.0
  ],
  "eye_h_m": 1736.4,
  "scene_az_minus_dem_az_deg": 93.8004,
  "skyline_min_deg": -3.724,
  "skyline_max_deg": -0.536,
  "source": "PGDA 90 LDEM_80S_80MPP_ADJ (Barker et al. 2023, PSJ 4:183), offset onto Site04 by 0.13 m",
  "normals": "mean over the samples of each span that show from the eye, and of the 5 bearings round it (weights 1 2 3 2 1), on LDEM_80S_80MPP_ADJ smoothed by a 120 m Gaussian",
  "normal_check_6deg": {
   "span_pairs_shown": 9093,
   "lit_dark_flips": 0.14,
   "NdotL_under_0.03": 0.197,
   "turn_deg_median": 5.03,
   "turn_deg_p90": 10.97
  },
  "about": "rows 0..spans-1: elevation code (R high, G low, (deg + 90) * 100, 0 = no data), B normal x; rows spans..2 spans-1: R normal z; normals in the scene frame, (n + 1) * 127.5; by DEM azimuth k/4 deg"
 },
 "farterrain_normals": {
  "file": "farterrain_n.png",
  "bearings": 7200,
  "rows": 192,
  "el0_deg": -4.1,
  "del_deg": 0.02,
  "halves": 2,
  "origin_xy_m": [
   -2762.0,
   -6238.0
  ],
  "eye_m": 1.65,
  "eye_h_m": 1736.4,
  "source": "PGDA 90 LDEM_80S_80MPP_ADJ (Barker et al. 2023, PSJ 4:183) smoothed by a 120 m Gaussian, offset onto Site04 by 0.13 m",
  "check": {
   "sun_1.5deg": {
    "lit_share": 0.602,
    "flips_up": 0.0252,
    "flips_across": 0.0139
   },
   "sun_6deg": {
    "lit_share": 0.728,
    "flips_up": 0.0162,
    "flips_across": 0.0106
   }
  },
  "about": "the normal of the first ground beyond 36 km seen from the origin in each direction; 3600 x 2 rows wide halves (bearings 0 to 180, 180 to 360), row r of a half at elevation el0 + (r + 0.5) del; scene x and z as 12 bit codes (n + 1) * 2047.5, R = qx >> 4, G = (qx & 15) << 4 | qz >> 8, B = qz & 255; bearings are DEM azimuths like farterrain.png"
 }
}