The maths
All the maths the tool does, in fourteen short steps.
Ektos is a blink and stereo comparator: it shows the same patch of sky at two dates and measures what moved. This page goes through the formulas behind those measurements, one by one. Each step first says what the formula is for; then come the formula itself, the meaning of its symbols, and a small figure you can play with.
The formulas are taken straight from the tool’s code; each step names the file they live in. The numbers are the measurements in the repository’s README.
A · earlier epoch B · later epoch live or selected 14 steps · the sliders are yours
Where does a point of sky land on the plate?
The sky is like the inside of a sphere, but a plate is flat. This formula moves a point on the sphere onto a flat surface that touches the sphere at the centre of the plate. The tool keeps every position on this plane, in arcseconds.
| Right ascension and declination of the point: its longitude and latitude on the sky. | |
| The centre of the plate. | |
| Distance from the centre on the plate, to the east and to the north. The formula gives radians; multiply by 206 264.8 to get arcseconds. | |
| The angle between the point and the centre of the plate. |
In the code: geom.py · tan_project, engine.js · tanProject
Sky level and noise of one exposure
In every exposure the sky itself glows a little, and every pixel is a little noisy. We have to measure both without being fooled by the stars. So we use the median instead of the mean: the value in the middle when the pixels are sorted. Pixels that are far off are thrown away, and the calculation is repeated.
| The pixel values in the window of the exposure. | |
| The sky level. It is subtracted from every pixel. | |
| The noise of one pixel. Later steps use it as a weight. | |
| The median. A few bright pixels shift the mean, but they cannot shift the median. | |
| For bell-shaped noise, the number that turns the median of the deviations into a standard deviation. | |
| The second line is the clipping rule: only pixels closer than 3σ to the sky level stay, and m and σ are computed again. Five rounds. |
In the code: frames.py · background
Putting an exposure on the common grid
Each exposure looks at the sky at a different angle. To compare them, we move them all onto one grid with north up. First we find which pixel of the exposure each grid point falls on. Then we work out the value at that point from the four nearest pixels.
| Column and row in the exposure’s own pixels. | |
| A 2 × 2 table of numbers. It holds how many arcseconds one pixel covers on the sky and how far the exposure is turned. | |
| Where pixel (0, 0) of the exposure sits on the plate. | |
| The fractional distance of the point from the centre of the first of its four neighbours: between 0 and 1. | |
| The values of the four neighbouring pixels. A closer neighbour gets a bigger share; the four shares add up to 1. |
M and c are found for each exposure separately, by fitting a linear map to 25 points taken from the file’s own coordinate information. The step of the common grid is 3.075″, half a SPHEREx pixel.
In the code: cube.py · fetch_exposure, frames.py · reproject, engine.js · reproject
Stacking the exposures
A single exposure is noisy. When we average the exposures of one visit, the noise drops and faint sources appear. A clean exposure gets a big say, a noisy one a small say. A flash that shows up in only one exposure, such as a cosmic-ray hit, is left out of the average.
| The value of the same grid point in exposure i. | |
| The pixel noise of that exposure (step 2) and its weight. Twice the noise means a quarter of the say. | |
| The value in the stack. | |
| The error of the value in the stack. If all exposures have the same noise it is σ/√N: four times the exposures, half the noise. | |
| The median of that point over all the exposures. The third line is the rejection rule: a value that meets it is thrown out. |
The rejection rule works only when there are at least three exposures. The threshold is wide on purpose: a point source falls on a different part of a pixel in each exposure and its flux changes with wavelength, so a tight threshold would also remove real sources.
In the code: frames.py · combine, engine.js · combine
How bright is a point source?
The light of a star does not fall on one pixel; it spreads over the neighbouring pixels in a known shape, called the PSF. To find the brightness we ask: how much of this shape, plus how much flat sky, explains the pixels best? The first number in the answer is the flux.
| The value of pixel i in the 7 × 7 pixel box around the source. | |
| The value of the PSF at that pixel: a Gaussian peak whose total light is 1. | |
| The distance of the pixel from the source, and the width of the peak. s = FWHM / 2.3548; the FWHM (full width at half maximum) is written in the header of each exposure. | |
| The two numbers we look for: the flux of the source and the sky level. | |
| The number of pixels in the box, and the noise of one pixel (step 2). | |
| The formal error of the flux: it counts pixel noise only. | |
| The area one pixel covers on the sky, in square arcseconds; it is in the header (about 38). 4.2545 × 10¹⁰ is the number of square arcseconds in one steradian; 10¹² turns MJy into µJy. |
This is nothing more than fitting a straight line to points: P on the horizontal axis, d on the vertical axis. The slope of the line is the flux, and the place where it meets the axis is the sky level. If there is another known source nearby, it gets a column of its own and everything is solved together. The Gaussian peak is an approximation: it is good enough for positions and relative fluxes, and leaves a systematic error in absolute fluxes.
In the code: phot.py · forced_flux, engine.js · forcedFlux
Where exactly is a source?
The position is the centre of gravity of the light. The two engines find it in different ways, and we say so openly. The Python engine fits a Gaussian peak to the image. The browser engine slides a window onto the source, step by step.
| The value and the error of pixel i of the stack; the pixel sits at (x, y). | |
| The position we look for. A is the height of the peak, B the background, s the width. All five are varied together until χ² is as small as possible. | |
| The misfit: the sum of the squared differences between model and pixels, in units of the error. | |
| The current centre of the window. The same formula is used for y. | |
| The weight of the window: a pixel near the centre counts a lot, a far one counts little. | |
| The correction in one step. It stops when this falls below 0.01″, after 12 steps at most. The 2 in front is there because a window as wide as the source halves the offset that is measured. |
HonestlyThe two methods do not have to give exactly the same answer for the same source. On WISE 0855, after the filter of step 7, the browser finds (−62.34″, +5.11″) and Python finds (−62.35″, +5.13″): a difference of 0.03″.
In the code: phot.py · fit_centroid, engine.js · centroid
Removing ordinary stars by their colour
A cold dwarf is bright at 4–5 µm and almost invisible at 3–3.8 µm. Ordinary stars show in both images, and the ratio of their brightness in the two is nearly the same for all of them. If we multiply the short-wavelength image by this ratio and subtract it from the long-wavelength image, the stars cancel and the cold object stays.
| The stack of the 4.0–5.0 µm window. | |
| The stack of the 3.0–3.8 µm window. | |
| The median flux ratio of the field’s own stars. Stars closer than 12″ to the target are left out. | |
| The reference stars in the field. | |
| The image that is left, and its error. The position (step 6) is measured on this image. |
- WISE 0855, October–December 2025
- k = 0.655 · 13 stars
- April–May 2026
- k = 0.593 · 10 stars
Why it is needed: today WISE 0855 sits 4–8″ from a fixed background star. Positions measured with the filter agree with the blind prediction within 1σ; without it, blended with the star, the measurement is off by 6σ in the worst epoch.
In the code: package.py · star_colour, analysis.py · spherex_epochs, engine.js · coldFilter
The motion model: a straight path plus a yearly wobble
A nearby object does two things on the sky: it moves along a straight line and, because Earth goes around the Sun, it draws a small wobble once a year. The model is the sum of the two. It has five unknowns, and we find all five together as the values that fit the measured positions best.
| Where the object is at time t₀ (east and north on the plate). | |
| Proper motion: how many arcseconds the object moves in a year. | |
| Parallax: the size of the yearly wobble, in arcseconds. | |
| The parallax factors: on that day, which way and how far the object appears shifted because of where Earth is. | |
| Where Earth is on that day, in astronomical units (our mean distance from the Sun is 1). α and δ are the place of the object on the sky. | |
| The best values of the five unknowns, and the measured positions (two numbers per epoch). | |
| A is the table that says how much each measurement depends on each unknown; W holds the weights, 1/σ². | |
| Measured minus model, and the total misfit. | |
| Degrees of freedom: the number of measurements minus the number of unknowns (n is the number of epochs). If the measurements scatter more than their errors allow, χ²/ν is larger than 1 and the errors are made larger by that ratio. |
| WISE 0855 | μα ″/yr | μδ ″/yr | ϖ ″ | χ² / ν |
|---|---|---|---|---|
| WISE + SPHEREx | −8.125 ± 0.009 | +0.686 ± 0.012 | 0.502 ± 0.038 | 66 / 47 |
| Published | −8.118 ± 0.008 | +0.680 ± 0.007 | 0.439 ± 0.002 |
The WISE detections that belong to the target are selected with the proper motion only; the parallax plays no part in the selection. So the parallax that comes out of the fit cannot have been put in by the selection.
In the code: geom.py · parallax_factors, propagate; motion.py · fit5; engine.js · parallaxFactors
From parallax to distance and speed
The smaller the wobble, the farther away the object is. Once we know the distance, we can also turn the motion on the sky into a real speed.
| Parallax, in arcseconds (step 8). | |
| Distance, in parsecs (pc). An object with a parallax of exactly 1″ is 1 pc away. | |
| Total proper motion, in arcseconds per year. | |
| Tangential speed: the speed across the line of sight, in km/s. | |
| The speed, in km/s, of an object that covers 1 astronomical unit in a year. |
- WISE 0855, measured parallax
- 0.502 ± 0.038″ → ≈ 2.0 pc
- published
- 0.439″ → 2.28 pc
- tangential speed, catalogue values
- ≈ 88 km/s
The honest statement: 0.50 ± 0.04 (statistical) ± 0.09 (systematic)″; the parallax is 1.7σ above the published value. The systematic is the part of the difference between the two halves of the WISE epochs that noise does not explain. WISE sets almost all of this value: SPHEREx's three epochs change it by 0.002″. Distance is not computed from the shift: the shift is proper motion, and distance comes from parallax. The distance and speed shown in the tool use the catalogue parallax.
In the code: analysis.py · _shower (1/ϖ), vr.js · updateMeas (4.74 μ / ϖ)
Is it real? Controls
In a crowded field, even a spot that looks empty holds light from stars that cannot be told apart. If a candidate’s signal is real, the same measurement at hundreds of empty positions should rarely look the same. First we remove the common colour of the stars. Then we join two bands into one number. Last, we count: how many empty positions came out this high?
| The flux in a long band: 3.8–4.4 or 4.4–5.0 µm. | |
| The 2.4–3.8 µm flux. A cold dwarf is dark here; ordinary stars are not. | |
| The common colour of the empty positions: the median of the slopes of the lines through every pair of positions (the Theil–Sen slope). A few odd positions cannot spoil it. | |
| The colour excess: the light that stars cannot explain. The median of the controls is set to zero. | |
| b counts the two long bands. T is the shape of a Y dwarf across them: 0.53 and 1. σ is the scatter of E at the empty positions (1.4826 · MAD). | |
| The matched filter: it adds the two bands into one number, with weights that suit the shape we look for. | |
| The number of empty control positions, and how many of them reach the target’s value of S. | |
| The chance probability. It comes from counting, not from a formula for the noise. The +1s count the target itself, so p is never zero. |
- SMDET-1: scatter, 4.4–5.0 µm
- 333 → 75 µJy
- empty positions that reach the target
- 25 / 300
- chance probability
- 26 / 301 ≈ 8.6%
Not a detectionThis is the result for SMDET-1: 25 of the 300 empty positions reach the same value. It is not a detection; it puts a number in place of the word “inconclusive” and shows that colour can push the crowding noise down. For WISE 0855, none of 150 empty positions reaches the target’s value.
In the code: analysis.py · cold_candidate, colour_excess
A light curve from a survey that never repeats a wavelength
SPHEREx sees a star at a different wavelength in every exposure. Did the brightness change, or is it just a different colour? To separate the two we assume this: the shape of the star’s spectrum stays the same, and only the whole of it gets brighter or fainter. Then, in the logarithm, two parts add up, and we solve for both together.
| The flux measured at time t and wavelength λ. Each exposure is one pair (λ, t). | |
| The mean spectrum of the star (its logarithm). | |
| The change in brightness that all wavelengths share: the light curve. One value for each 10-day bin. | |
| The condition that keeps the two parts apart: the light curve has zero mean. | |
| The same change in magnitudes; plus means brighter. | |
| The period, in days. It is tried in steps of 0.5 day; the one with the smallest misfit (χ²) wins. | |
| Found by least squares for each P. The peak-to-peak amplitude is 2√(c₁² + c₂²). |
- R Draconis, fitted period
- 267 days
- honest range
- 250–280 days
- published
- 245.6 days
The formal result is 267 ± 5 days (45 bins, χ² 150.7 / 42), with 1.7 magnitudes from peak to peak. But the data span 520 days, only 1.95 cycles, and the formal error understates the real uncertainty; the right statement is “about 250–280 days”. The core is saturated in 99.6% of the exposures, so the flux was measured in the wings of the image.
In the code: variable.py · decompose, period_fit
Stereo depth
The left eye sees epoch A, the right eye sees epoch B. A star that stayed put falls on the same spot for both eyes and appears on the plate. An object that moved falls on slightly different spots, and the brain reads this as depth. The amber ring in the headset is placed at a chosen depth in the same way.
| The distance at which the object (or the ring) appears. | |
| The distance from the eyes to the plate: 2.0 m. | |
| The distance between the two pupils: 63 mm. | |
| How far apart the two eyes’ images are on the plate, in metres. If it is positive the object appears behind the plate; if negative, in front of it. | |
| The shift of the object between the two epochs, in arcseconds. | |
| The width of the plate (1.6 m) and the field of sky it shows (5.0′, about 300″). | |
| The magnification: the angle the plate covers for the eye, divided by the real angle of the patch of sky it shows. About 520. |
LimitAs d gets close to the eye separation, Z goes to infinity. If d is larger still, the sight lines never meet and the image doubles. The roughly 130″ shift of WISE 0855 between 2010 and 2026 is 43% of the plate; in the headset that is about 19° apart, and it cannot be fused. Stereo is for shifts of a few arcseconds. Whether stereo is better than blink has not been measured, and that the object separates in depth has not yet been confirmed in the headset.
In the code: vr.js · updateMeas (Z), arcsecPerM (d), mag (M)
The injection test: would you have seen it?
We add a synthetic source of known brightness and known shift to the real exposures, and see whether it is found. We choose its brightness as a multiple of the noise at that spot. The same list of trials goes to people and to a machine observer. In the end we have numbers like “9 of 10 trials”, and we give an interval that says how far they can be trusted.
| The formal flux error at the source position in exposure i (step 5). | |
| All the exposures of one epoch together: the flux error of that epoch. A and B are the two epochs; the larger of the two is used. | |
| The chosen formal signal-to-noise ratio: 6, 10 or 16. | |
| The 3 × 3 pixel mean of the difference plate. med and MAD are the median and the median deviation of this mean over the whole plate. | |
| How many sigmas is the difference? The source counts as “found” if z is above 5 within 12″ of it, and below 5 there on the plate without the injection. | |
| The number of hits and the number of trials. | |
| The two ends of the Wilson interval: the range that most likely (1σ, about 68%) holds the true rate. It still makes sense for extreme results such as 0 / 10 or 10 / 10. |
- closed loop: injected, recovered
- 275.85 → 275.85 µJy
- exposures recovered
- 40 / 40
Not yet runThe human experiment has not been run yet. The numbers here belong to the machine observer alone; they do not hold for human observers and say nothing about stereo versus blink.
In the code: inject.py · flux_sigma, build_trial, zmap; experiment.js · wilson
The cost of reading the archive
The tool does not download whole files; it asks only for the header and the pixel rows it needs. Before it downloads anything, it uses this formula to estimate how many bytes a field will cost, and shows the number in the interface.
| The total number of bytes, and the number of exposures. | |
| The header read: 31 680 bytes (11 blocks of 2880 bytes). | |
| The overhead of each request: 750 bytes. | |
| One side of the window and its half-size, in pixels. For a 5′ window h = 24 and n = 49. | |
| The cost of one row. Each row is a separate request: n pixels of 4 bytes each, plus the overhead of the request. |
- per exposure
- ≈ 80 kB
- 358-exposure, 5′ field
- ≈ 29 MB
- same job, cutout service
- ≈ 1.4 GB
The cutout service sends a 3.86 MB PSF table with every cutout: 3.95 MB per cutout. The estimate holds: for a 450-exposure field that had never been opened before (Luhman 16) the formula said 35.5 MB, and the measured total was 36.4 MB (catalogues included).
In the code: cube.py · estimate_bytes, remote.py · _HEAD_BYTES, net.py · OVERHEAD
The story of the method behind these formulas is on the “How it works” page; all the numbers and their limits are in the repository’s README. None of them says that we discovered a new object.