📖 Introduction & Architecture
JSMARS is an open-source, client-side web application providing high-performance geospatial data visualization, orbital tracking, planetary climatology, and geophysical modeling for Mars, the Moon, and Earth.
⚡ Zero Build Step
Written in standard Vanilla JavaScript (ES6+ Modules), Leaflet, HTML5 Canvas, and WebGL Three.js. No Webpack, Vite, or npm compilation required.
🔬 Desktop Parity (~91%)
Faithfully ports mathematical models, physical constants, and analytical pipelines from Java-based JMARS desktop into fast client-side JavaScript.
🛡️ Continuous Automated CI
Covered by 218 automated unit tests (100% passing) and automated headless browser verification pipelines ensuring 0 console errors.
🚀 Getting Started
To use JSMARS locally or in production:
- Open
index.htmlin any modern browser (Chrome, Firefox, Safari, Edge) via an HTTP server or GitHub Pages. - Use the Sidebar on the left to toggle analytical tools, add base maps from USGS/OpenPlanetary WMS feeds, and customize layers.
- Use the Panner Overview (bottom-right) or standard map controls to pan and zoom across the planetary surface.
⌨️ Keyboard Shortcuts & Quick Actions
Press Ctrl+K (or ⌘+K on macOS) to focus the Quick Command input at any time.
| Shortcut / Command | Action |
|---|---|
Ctrl+K / Cmd+K | Focus Quick Actions search box |
Save Session | Download current session (active layers, bookmarks, measurements) as JSON |
Load Session | Upload and restore a saved JSMARS JSON session |
Reset View | Reset map center to 0° Lat, 0° Lon at global zoom level |
Toggle Sidebar | Collapse or expand the left sidebar controls |
🌡️ 1D KRC Mars Thermal Simulation Model
Physics EngineThe KRC engine solves the 1D transient heat diffusion equation in the Martian regolith coupled with surface radiative energy balance and atmospheric downward thermal infrared flux (Hugh Kieffer KRC formulation).
Surface Boundary: (1 - A)*F_sun + F_IR,down - eps*sigma*T^4 + k*(dT/dz)|_0 = 0
Key Capabilities:
- Diurnal & Seasonal Curves: Simulates diurnal temperature swings ($T(t)$) and full orbital seasonal curves across Solar Longitude ($L_s = 0^\circ - 360^\circ$).
- CO2 Frost Condensation: Accurately clamps surface temperatures to the Clausius-Clapeyron dry ice condensation point ($T \approx 145-148\text{ K}$) and models sublimation mass flux.
- Two-Layer Apparent Thermal Inertia ($\Gamma_{\text{app}}$): Disentangles fine airfall dust mantles over high-conductivity volcanic basalt bedrock.
- Fourier Harmonics Deconvolution: Extracts fundamental harmonic amplitudes ($C_k$) and phase lag hours from diurnal temperature waves.
⏱️ Mars Time Slider & Orbital Ephemeris
Astronomical EngineComputes orbital mechanics, Keplerian true anomaly, Solar Longitude ($L_s$), Mars Year (MY), Mars Sol Date (MSD), and Local True Solar Time (LTST) using high-precision Allison & McEwen (2000) formulations.
True Solar Sol Duration: delta_t(Ls) = 88775.244 * [1 + 2e*cos(Ls - 251 deg) / (1 - e^2)]
💨 Mars Climate Database (MCD) Profiler
Atmospheric SounderGenerates vertical atmospheric soundings from surface datum to 120 km altitude, modeling hydrostatic scale height, dry adiabatic lapse rates ($4.5\text{ K/km}$), Conrath dust vertical distribution ($\nu = 0.007$), boundary layer friction velocity ($u_*$), and potential temperature ($\theta$).
☄️ Crater Counting CSFD & Isochron Dating
GeochronologyImplements the Neukum Production Function (NPF 11th-order polynomial) and Hartmann-Neukum Mars Chronology Function to date planetary surface units:
Croft & Ivanov Collapse: D_f = 1.17 * D_t^1.13 / D_*^0.13 (D_* = 7 km)
💎 Hyperspectral Band Math & Mineralogy
SpectroscopyCalculates CRISM summary parameters including ferric iron (BD530), hydration (BD1900), water ice (BD1500), smectite clays (D2300), sulfates (BD2100), and carbonates (BD2500/BD3900), plus Olivine Forsterite $\text{Fo\#}$ estimation from $1\ \mu\text{m}$ absorption center minimums.
🌐 3D Terrain & Globe Viewer (WebGL)
3D GraphicsRenders regional elevation displacement meshes and 3D planetary globes with dynamic vertical exaggeration scaling ($1\times - 20\times$), real-time solar terminator illumination, Lambertian/Lommel-Seeliger/Minnaert photometric models, camera FOV ground swath width footprint ($W = 2 h \tan(\text{FOV}/2)$), and facet normals.
📡 Subsurface Radar Sounder (SHARAD / MARSIS)
GeophysicsSimulates synthetic 2D B-scope radargrams and 1D A-scope power traces for subsurface orbital radar sounding across polar ice caps and sedimentary deposits with dielectric mixing laws (Looyenga, Birchak, Lichtenecker) and two-way travel time dielectric depth conversion ($z = \frac{c \Delta t}{2 \sqrt{\epsilon_r}}$).
🚀 Interplanetary Astrodynamics & Trajectories
Mission PlanningCalculates heliocentric Hohmann transfer orbits, Trans-Mars Injection ($\Delta v_1$), Mars Orbit Insertion ($\Delta v_2$), characteristic launch energy ($C_3$), synodic transfer opportunities, and Areostationary synchronous orbit altitudes.
⛰️ Topographic Contours, Slopes & Landing Hazards
CartographyGenerates client-side Marching Squares elevation isocontours, 3x3 Zevenbergen-Thorne slope & aspect gradients, Topographic Wetness Index (TWI), Stream Power Index (SPI), and automated landing site hazard safety classification.
🗺️ Map Projections & Coordinate Systems
GeodesySupports Cylindrical Equirectangular, North/South Polar Stereographic, Albers Equal-Area Conic, Lambert Azimuthal Equal-Area, Sinusoidal, and Mollweide projections with real-time coordinate transformations across $0^\circ-360^\circ\text{ E}$, $\pm 180^\circ$, and West longitude.
📍 Investigate Probe Tool & Potential Fields
GeophysicsClick anywhere on Mars or the Moon to probe MOLA DEM elevations, WMS layer attributes, Complete Bouguer gravity anomalies ($\Delta g_B$), Airy-Heiskanen isostatic crustal roots ($t_{\text{root}} = h \frac{\rho_c}{\rho_m - \rho_c}$), and thermal diffusivity ($\kappa = \frac{k}{\rho c_p}$).
📏 Geodesy & Distance Measurements
NavigationCalculates planetary radius-calibrated geodesic line lengths, closed polygon surface areas, great-circle waypoint interpolation, cross-track/along-track offsets, direct destination points, and 3D interior straight-line tunnel chords.
✏️ Vector Shapes (ROIs) & GIS Formats
GIS InteroperabilityDigitize points, polylines, polygons, circles, and bounding boxes. Export to GeoJSON, CSV, WKT (Well-Known Text), and generate 6-line affine transformation world files (.pgw / .jgw) for QGIS, ArcGIS, and GDAL.
🏷️ Planetary Nomenclature & Gazetteer
GazetteerSearch over thousands of IAU official planetary landmarks across Mars and the Moon, filter by morphological feature type (craters, mons, valles, chasmata, planitiae), and recenter the map with one click.
🗂️ Layer Manager & Overlays
Map CompositionReorder layer stacking via drag-and-drop, adjust transparency with real-time opacity sliders, toggle adaptive coordinate graticules, north arrows, and physical scale bars.
💾 Session Management & Serialization
PersistenceSave entire workspaces—including active layer stack, opacity settings, viewport center, zoom, spatial bookmarks, measurements, and vector shapes—into compact JSON session files with instant restore.