You are browsing as a guest. Sign up (or log in) to start making projects!

Umbra

  • 5 Devlogs
  • 19 Total hours

Simulates exoplanet transit detection from Earth, with variables that can be used to explore how different planet sizes and orbits can affect a star's observed light curve.

Ship #1

umbra is a browser-based exoplanet transit simulator. you get a star, a planet on an adjustable orbit, and a live light curve that dips every time the planet crosses in front of the star. sliders control planet size, orbit radius, orbit speed and eccentricity, and there's a set of presets so you can jump straight to different planet types (hot jupiter, super-earth, earth-like, etc) without tuning everything by hand.

getting the orbit itself right was very hard. circular orbits are easy, but real planets have eccentric ones, which means solving kepler's equation to work out where the planet actually is at any given moment. did that with newton-raphson, a handful of iterations converges fast enough to run every frame without lagging.

have fun!

  • 5 devlogs
  • 19h
  • 12.73x multiplier
  • 243 Stardust
Try project → See source code →
Open comments for this post

3h 3m 14s logged

Umbra — Adding Some Chaos (On Purpose)

  • Real telescopes don’t hand you a perfect light curve, they hand you a noisy mess with a signal buried in it, so I added a noise toggle to make Umbra actually look like real data instead of a simple ahh textbook diagram

  • Used a Box-Muller transform to turn two uniform randoms into a proper gaussian sample, tuned roughly to TESS-scale scatter so it’s not comically noisy, just enough to make the dip look like something you’d actually have to squint at

  • New “N” button sits next to the reset one, goes amber when it’s on, same button family as everything else up there

  • The bit I actually spent time thinking about, which was that the noise only touches what gets drawn on the graph, not the underlying flux value. Transit detection, transit counting, period measurement, and the stats panel all still read the clean number

  • I wanted it this way on purpose, in real analysis you don’t just throw the noise away, you fit the curve through it, so having Umbra’s detection stay accurate underneath a noisy-looking graph felt like the more honest way to represent that, rather than making the sim itself worse at its job just for realism points lol

0
0
3
Open comments for this post

2h 20m 28s logged

Umbra - Making the Dip Actually Mean Something

  • Kepler solved the “where the heck is the planet” issue, but I still had a “how much light does it actually block” issue, and the answer wasn’t as simple as I first thought
  • My first instinct was just measuring the distance between planet and star centres and eyeballing a dim amount from that, which is wrong the second the planet is anything other than fully in or fully out
  • What you actually need is the overlap area between two circles, so I built circleOverlapArea() using the proper lens equation, it takes the centre distance plus both radii and works out the exact overlapping region
  • This is what gives you the sloped ingress and egress on the light curve instead of a dip that just snaps to a flat bottom, which is a lot closer to what a real transit looks like
  • Also added depth ordering off the back of this, since I needed to know when the planet’s on the near side of the orbit vs the far side so it draws in front of or behind the star correctly (sin of the eccentric anomaly tells you which side you’re on, handy)
  • Once the flux number was actually trustworthy, I edited the instrumentation to go with it:
    • fixed the stats panel (radius ratio, current flux, transit depth, max depth, eccentricity, transit count, measured period)
    • rising-edge detection so it counts transits and times the period itself, rather than me just reading it off the speed slider
    • fixed the light curve graph itself, plotting flux over time with gridlines so you can actually see the dip shape as it happens

Genuinely didn’t expect the geometry bit to be the harder half of this session, Kepler felt like the scary one going in but the overlap maths turned out to be the fiddlier of the two!

I also distributed all my code into separate files as for some reason I put it all inline in one html file and I got some reviews about file structure on my other projects, so didn’t want to repeat that lol

0
0
1
Open comments for this post

4h 1m 57s logged

Umbra — Kepler’s Equation Nearly Broke Me

  • So remember in the first devlog when I said I spent 2+ hours just getting the orbit right? Turns out “right” was still wrong, the planet was moving at constant angular speed the whole time, which is basically not how orbits work

Real orbits speed up near the star and slow down far away (thanks Kepler), so I had to actually solve Kepler’s equation properly instead of faking it
Problem is M = E − e·sin(E) has no closed-form solution for E, you can’t just rearrange and solve for it like a normal equation, which I did not know going in and briefly panicked about

Ended up using Newton-Raphson to solve it numerically, feels very full circle after doing the same kind of thing for my EPQ (orbital sim for near-Earth objects), except this time it’s converging in like 5 iterations instead of me validating against JPL Horizons for weeks lol

  • The difference is honestly crazy to look at now, the planet visibly rips through periapsis and crawls through apoapsis instead of just gliding round at one speed the whole way, which is exactly what real eccentric orbits do

Pretty happy with this 4 hours cause it means I now have actual physics rather than some fake thing only added for the visuals.

below are some snippets from the solvers but not the full code of course

0
0
2
Open comments for this post

5h 3m 57s logged

Umbra - Major Update!

Ok, I’ll admit I wasn’t too consistent with devlogging as I was with my other projects, so I’ll keep this detailed for that storytelling rating :stardance_star:

  • So I started by adding the four sliders - the planet radius, orbit radius, speed, and eccentricity. The eccentricity one was probably the most interesting to build because I didn’t want it to just go from 0 to max in one direction, I made it signed so zero sits in the middle of the slider and you can push the elongation either way. Felt much more intuitive to use.

  • I also had to add a clamp so the orbit can’t intersect the star — without it you could drag the eccentricity up until the planet was literally passing through the star which looked awful. It recalculates the safe maximum every frame based on whatever the other sliders are at, and goes amber with a little “(max)” label if you’re hitting the ceiling.

  • Then I added presets (as always lol): Hot Jupiter, Super-Earth, Earth-like, Eccentric Giant, Grazing Transit, as a dropdown that snaps all the sliders at once. Wanted a way to show off what different orbit types actually look like on the light curve without the user having to dial everything in manually.

  • Each preset fires a little toast notification from the top of the screen with a one-liner about what makes that orbit interesting, which I’m pretty happy with.

  • Last thing was the reset button — just a ↺ in the top right that puts everything back to defaults and clears the graph.

  • Small thing but its actually really useful when you’ve been toying around with this all day 😭, saves me a bit of sanity.

If you want more on what I did and why I did it feel free to check out https://instagram.com/urged.st where I post video devlogs!

0
0
5
Open comments for this post

4h 37m 36s logged

Umbra Begins

Alright, we’re really hitting the ground running with this one.

  • Started yesterday and I’m already 4 hours deep (my goal is 10hrs minimum for each simulator)

  • Added the heavy UI now so I don’t have to write paragraphs later (wasn’t too bad lol, same styling as the other two sims)

  • Added an orbiting planet

(yes I spent two hours + on the planet and getting its orbit right…)

0
0
8

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…