<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ibrahim Sadat</title>
    <description>The latest articles on DEV Community by Ibrahim Sadat (@ibrahimsadat).</description>
    <link>https://dev.to/ibrahimsadat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4247851%2F3e5e2238-bcc7-4b7c-8da5-9806de51b01d.png</url>
      <title>DEV Community: Ibrahim Sadat</title>
      <link>https://dev.to/ibrahimsadat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ibrahimsadat"/>
    <language>en</language>
    <item>
      <title>TwinWorlds: Finding the Places on Earth That Can Stand In for Mars and the Moon</title>
      <dc:creator>Ibrahim Sadat</dc:creator>
      <pubDate>Tue, 17 Nov 2026 18:57:00 +0000</pubDate>
      <link>https://dev.to/ibrahimsadat/twinworlds-finding-the-places-on-earth-that-can-stand-in-for-mars-and-the-moon-3lp6</link>
      <guid>https://dev.to/ibrahimsadat/twinworlds-finding-the-places-on-earth-that-can-stand-in-for-mars-and-the-moon-3lp6</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/mlh-hackathon"&gt;MLH x DEV Writing Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;Before a rover drives a single meter on Mars, someone has to drive it on Earth first. NASA and other agencies test rovers, drills and crew procedures at "analog sites": the Atacama Desert, Devon Island, the Mars Desert Research Station in Utah. But when I started reading about them, I noticed something odd. Most analog sites are chosen by reputation and described with adjectives. "Mars-like." "Lunar-like." Nobody could tell me &lt;em&gt;how&lt;/em&gt; Mars-like, or which conditions a site actually matches.&lt;/p&gt;

&lt;p&gt;So my teammate Zohaib Riaz and I built &lt;strong&gt;TwinWorlds&lt;/strong&gt; for NASA Space Apps 2026. It scores every land area on Earth (79,625 cells on a 0.5 degree grid) against any spot on Mars or the Moon, and shows the results on two linked 3D globes.&lt;/p&gt;

&lt;p&gt;You pick a target, for example Perseverance's landing site in Jezero crater, and Earth lights up as a heatmap of how well each place matches.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr1egub8lvsuogdn8k5ly.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr1egub8lvsuogdn8k5ly.jpg" alt="Twin globes: Mars above, Earth below with the Jezero heatmap" width="800" height="962"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Mars on top, Earth below. Red on Earth = the top 0.5% of places for Jezero.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The core rule: same measurement, both worlds.&lt;/strong&gt; We only compare things that are measured the same way on Earth and on Mars or the Moon:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;slope and hilliness (from elevation data: MOLA for Mars, LOLA for the Moon, USGS GMTED2010 for Earth)&lt;/li&gt;
&lt;li&gt;daytime and night-time ground temperature, and the day-night swing (TES and the Mars Climate Database, LRO Diviner, MODIS)&lt;/li&gt;
&lt;li&gt;surface brightness (albedo) and plant cover (NDVI)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each measurement gets a bell-curve similarity score, with the width set by how much that quantity naturally varies across Earth. The scores are combined with a &lt;strong&gt;weighted geometric mean&lt;/strong&gt;, so one terrible mismatch can't hide behind several good ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The part I'm proudest of: being honest about what Earth can't do.&lt;/strong&gt; Mars nights at Jezero average about −71 °C at the hour we compare, colder than any annual average on Earth. If you force that into the score, the coldest corner of Antarctica wins every single time. So when a target's value is beyond anything on Earth, that measurement &lt;em&gt;doesn't vote&lt;/em&gt;. Instead it shows up as a gap, next to the hardware teams use to fake it (thermal vacuum chambers, offloading rigs for low gravity, UV lamps because Mars has almost no ozone).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Proving it works: a blind test.&lt;/strong&gt; We never told the engine where the famous analog sites are. Then we checked where they rank. For Jezero, Utah's Mars Desert Research Station lands in the top 0.7% of Earth's land, and the Mojave, Danakil, the Atacama and the Icelandic highlands all land in the top 1.5%. Random chance would put them around the top 50%.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fif4l1o3a7bx0uwxksmeh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fif4l1o3a7bx0uwxksmeh.jpg" alt="Blind test results in the Proof tab" width="800" height="582"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The Proof tab: famous analog sites the engine was never told about, and where they ranked.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Other things you can do in the app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mission Twin:&lt;/strong&gt; we take Perseverance's real drive (from NASA's MMGIS traverse files), cut it into 250 m segments, and use dynamic time warping to find an Earth path whose slopes and climbs follow the same sequence. Then we pick the dates and hours when that Earth path's ground temperature and sun angle are closest to what the rover saw.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mission lenses:&lt;/strong&gt; rescore Earth for landing, rover driving, a lunar base, thermal testing or astrobiology.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rehearsability Map:&lt;/strong&gt; colours all of Mars and the Moon by how well &lt;em&gt;anywhere&lt;/em&gt; on Earth can stand in for each spot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Science panels:&lt;/strong&gt; thermal inertia from a heat-flow model, dust, water vapour and UV shielding, rover chemistry from Curiosity and Perseverance, and mineral spectra (CRISM from Mars orbit vs NASA EMIT from Earth orbit).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Normal and Nerd modes:&lt;/strong&gt; plain language, or the full maths with histograms and every number's source.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy7dus5zunx8x3akxwoxm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fy7dus5zunx8x3akxwoxm.jpg" alt="Mission Twin: Perseverance route and its Earth twin path" width="800" height="962"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Mission Twin: Perseverance's real route in Jezero (top) and its matched path in the Altyn-Tagh mountains, China (bottom), flying in sync.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmy9ndsgy31daiahw3s08.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmy9ndsgy31daiahw3s08.jpg" alt="Nerd mode scoring table" width="800" height="445"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Nerd mode shows every step of the score, including the measurements that are "beyond Earth" and don't vote.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What I learned (the bug that taught me the most)
&lt;/h3&gt;

&lt;p&gt;On the last morning, during a final review, I noticed a few "top matches" kept showing up for almost every Mars target: Kazakhstan, Turkmenistan, the Canadian Shield. That smelled wrong, so we checked the raw cells.&lt;/p&gt;

&lt;p&gt;"Turkmenistan 41.75°N 53.75°E" was 96% Caspian Sea. "Kazakhstan" was Lake Balkhash. "Canadian Shield" was Lake Athabasca.&lt;/p&gt;

&lt;p&gt;Water is perfectly flat and has no plants, which is exactly what a Mars surface looks like to a satellite. Normally the temperature data would rule lakes out. But for very cold targets, temperature stops voting (the honesty rule above), and lakes slipped straight through. For one target, 31 of the top 200 matches were mostly water.&lt;/p&gt;

&lt;p&gt;The fix: we rasterised Natural Earth's lake and inland-sea outlines and multiplied every score by the share of each cell that isn't inland water. We applied it in every place a score gets computed: the Python pipeline, the browser, the API and the Rehearsability Map. We deliberately didn't penalise sea coasts, because MODIS land products already exclude the ocean; otherwise island analogs like Lanzarote would have been punished unfairly.&lt;/p&gt;

&lt;p&gt;Afterwards the lakes vanished from every list, the blind test stayed the same, and the best Earth match for the Moon's Shackleton crater became the McMurdo Dry Valleys in Antarctica, a famous real analog the engine had never been told about.&lt;/p&gt;

&lt;p&gt;The lesson I'll keep: &lt;strong&gt;when a result is "too common", check whether it's logic or a glitch.&lt;/strong&gt; A rule that's honest in one place (letting impossible measurements abstain) can open a hole somewhere else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Live site:&lt;/strong&gt; &lt;a href="https://twinworlds.us" rel="noopener noreferrer"&gt;https://twinworlds.us&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;7-slide demo:&lt;/strong&gt; &lt;a href="https://drive.google.com/file/d/1zn3rRLVPEXRdQrxyhFHlS_O6pysMO_hD/view" rel="noopener noreferrer"&gt;https://drive.google.com/file/d/1zn3rRLVPEXRdQrxyhFHlS_O6pysMO_hD/view&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/ibrhaimsadat123/Fullbuild" rel="noopener noreferrer"&gt;https://github.com/ibrhaimsadat123/Fullbuild&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public API docs (with "Try it"):&lt;/strong&gt; &lt;a href="https://twinworlds.us/api.html" rel="noopener noreferrer"&gt;https://twinworlds.us/api.html&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F928z6jzljzo36ff98v9l.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F928z6jzljzo36ff98v9l.jpg" alt="Top Earth matches for Jezero in Spread worldwide mode" width="800" height="645"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The top-places list in "Spread worldwide" mode: the best match on each part of the planet, at least 2,000 km apart.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Try this: pick &lt;strong&gt;Jezero crater floor&lt;/strong&gt;, then switch the top-places list from "Closest" to &lt;strong&gt;"Spread worldwide"&lt;/strong&gt; to see the best option on every continent. Then open the &lt;strong&gt;Proof&lt;/strong&gt; tab for the blind test.&lt;/p&gt;

&lt;h2&gt;
  
  
  Partner Technologies
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Google Gemini API.&lt;/strong&gt; Gemini powers the in-app explanations: "Explain this match", "Ask the Planet" (type something like "flat dusty ground for a lander" and it turns that into lens weights), What-if, and a Field Brief for a matched site. We were strict about one rule: &lt;strong&gt;Gemini only ever sees measured numbers, and it never changes a score.&lt;/strong&gt; Every reply is labelled "AI-generated from measured data", and the Field Brief uses a JSON schema so the output is structured, not free text. Gemini models get renamed or rate-limited, so the API key takes a comma-separated list of models and falls through to the next one on a 404 or 429. The key lives only as a Cloudflare Worker secret, never in the frontend or the repo.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloudflare Pages and Workers.&lt;/strong&gt; The app is static (CesiumJS, Chart.js, Vite) and hosted on Cloudflare Pages. The API is a Cloudflare Worker with routes for analog search, live Mars conditions and the Gemini features. A Cron Trigger runs every hour to compute "right now" values: current Mars local time and season (using the Mars24 algorithm), and modelled ground temperature at the target. Results are cached with the Cache API. We checked our Mars clock against an independent implementation of Mars24 and they agreed to within a few hundredths.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GoDaddy Registry (.us domain).&lt;/strong&gt; The site lives at &lt;strong&gt;twinworlds.us&lt;/strong&gt; (.us domains are run by GoDaddy Registry), pointed at Cloudflare Pages with Cloudflare handling DNS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hackathon Experience
&lt;/h2&gt;

&lt;p&gt;I took part in &lt;strong&gt;NASA Space Apps Challenge 2026, New York City Local Event&lt;/strong&gt;, virtually from &lt;strong&gt;Lahore, Pakistan&lt;/strong&gt;, as team &lt;strong&gt;Connected, No Internet&lt;/strong&gt;. It was my first hackathon.&lt;/p&gt;

&lt;p&gt;New York is 10 hours behind Lahore, so the official schedule ran through our nights, and the final deadline landed early on a Monday morning here. Zohaib and I split the work: data, scoring and validation on one side; 3D globes, frontend, API and deployment on the other.&lt;/p&gt;

&lt;p&gt;Honest numbers, since that's the theme of this project: &lt;strong&gt;36 hours, 8 coffees, 0 sleep.&lt;/strong&gt; By the last stretch my brain was running on caffeine and pure stubbornness. In the final hours before the deadline I convinced myself &lt;strong&gt;three separate times&lt;/strong&gt; that I had missed the submission. Each time I opened the portal in a panic, and each time it was fine and the clock still had time on it. By the third time I just laughed and went back to fixing the lake bug.&lt;/p&gt;

&lt;p&gt;I don't recommend the zero-sleep part. But I'll never forget the moment the McMurdo Dry Valleys popped up on its own as the Moon's best match on Earth, at an hour when I wasn't sure what day it was.&lt;/p&gt;

&lt;p&gt;What I'll remember most is that being honest made the project &lt;em&gt;better&lt;/em&gt;, not weaker. Showing where Earth falls short, reporting the blind-test misses, and chasing down the lake bug at the last minute all made the results more trustworthy. It also made the project more interesting to explain. One surprise for us: several places in Pakistan, like the Chagai Hills and the Hingol mud volcanoes, rank in the top 2% of Earth for real Mars targets, and none of them is on the usual analog lists.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A note on AI use:&lt;/strong&gt; Claude (Anthropic) helped us write and debug code, process data and draft writing. Gemini powers the labelled in-app explanations. The idea, the scoring rules and the design decisions are ours, and every number in the app comes from a cited dataset.&lt;/p&gt;

&lt;p&gt;If you build anything with space data, I'd love to hear about it in the comments.&lt;/p&gt;

</description>
      <category>mlhacks</category>
      <category>devchallenge</category>
      <category>hackathon</category>
      <category>space</category>
    </item>
  </channel>
</rss>
