📖 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, Earth, and Europa.
⚡ 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
Use global keyboard shortcuts to quickly navigate the map, adjust zoom, manage sessions, and trigger GIS tools.
| Shortcut | Action |
|---|---|
+ / - | Zoom In / Zoom Out |
1 - 5 | Quick Zoom Levels (Global to Regional) |
R | Reset Map View to Global Center |
Ctrl+G | Go to Coordinates (Lat, Lon Prompt) |
Ctrl+S | Save Current Session (JSON) |
Ctrl+O | Load Saved Session File |
Ctrl+Shift+E | Export Map View as High-Res PNG |
Esc | Cancel Active Drawing / Tool |
F | Toggle Fullscreen Mode |
? | Show Keyboard Shortcuts Modal |
🌡️ 1D KRC Mars Thermal Simulation Model
Physics Engine ModelThe KRC engine is a client-side simulation (Hugh Kieffer KRC analog). It solves the 1D transient heat diffusion equation in Martian regolith coupled with surface radiative energy balance. Output is modeled temperature, not TES, THEMIS, or lander measurements.
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
Atmosphere Model or Live GCMOffers an explicit choice of a 1D analytical physics model (offline) or live LMD MCD v6.1 GCM (climate model, not a spacecraft profile). If the live fetch fails, the analytical model is used and labeled Offline Fallback.
☄️ 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)
💎 Educational Mineral-Index Visualizer
Spectroscopy Model / EducationalApproximate, client-side CRISM-style band-depth formulas (BD530 ferric iron, BD1900 hydration, BD1500 water ice, D2300 smectite, olivine index) rendered as illustrative overlays. Does not ingest per-pixel CRISM, OMEGA, or THEMIS cubes. Treat as a teaching visualizer until real multi-band rasters are wired in. Measured products: PDS CRISM and THEMIS archives.
🌐 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 (simulation)
Geophysics ModelPhysically-based synthetic 2D B-scope radargrams and 1D A-scope traces using illustrative dielectric presets (Planum Boreum, Planum Australe, Medusae Fossae, Utopia Planitia, Europa ice-shell analogs). Not observed SHARAD, MARSIS, REASON, or RIME radargrams. Two-way travel time conversion $z = \frac{c \Delta t}{2 \sqrt{\epsilon_r}}$ is a model. For measured data see the PDS Geosciences Node SHARAD and MARSIS archives.
🚀 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.