How OmnAstro computes the sky-brightness estimate shown for an observing place, with the formulas as implemented, and how its conversion constant was calibrated on Japan's national star-watching measurements. Every figure below can be regenerated from the open-source repository and the datasets listed at the end.

How dark is this site, in numbers

A Sky Quality Meter (SQM) gives the surface brightness of the zenith sky in magnitudes per square arcsecond (mag/arcsec²). The scale is logarithmic and inverted: one magnitude more is a sky 2.512 times fainter. When sky noise dominates, the integration time needed for a given signal-to-noise ratio on a faint target is proportional to the sky background, so a sky one magnitude darker divides that time by about 2.5.

The Bortle scale has nine classes defined by visual criteria. The app derives a class from an SQM value with fixed thresholds (bortleFromSqm); the last column is the ratio of artificial to natural luminance at the bright limit of each class, for a natural sky of 22.0 mag/arcsec²:

Bortle SQM (mag/arcsec²) Artificial / natural
1 ≥ 21.99 0.009
2 21.89–21.99 0.11
3 21.69–21.89 0.33
4 20.49–21.69 3.0
5 19.50–20.49 9.0
6 18.94–19.50 16
7 18.38–18.94 27
8 17.00–18.38 99
9 < 17.00 —

Classes 1 to 3 together span 0.30 mag; class 4 alone spans 1.20 mag, a factor of 3.0 in brightness. Two "Bortle 4" sites can differ threefold in sky background, which is why the SQM value is shown next to the class.

From satellite radiance to an SQM value

Input. The VIIRS Nighttime Lights annual composite of the Earth Observation Group (EOG), version 2.2, year 2025, product average_masked: upward radiance in nW/cm²/sr on a 15″ grid, with noise, aurorae and fires removed. It is downloaded once, when the raster is built; an estimate is then a lookup in a local file, on the portal's server or, without network, on the phone. No position is sent to a third-party service.

Resampling and propagation. An area-weighted mean brings the composite onto a 2′ grid (10,800 × 5,400 cells, about 3.7 × 3.0 km at 35° N). The satellite sees light leaving the ground; an observer sees light scattered over a wide area. Each cell therefore stores the radiance of everything within 300 km, weighted by a distance kernel from Duriscoe et al. (2018):

P(x) = Σ_s R_s · A_s · K(d_xs) / ∫ K dA
K(d) = d^(−α(d)),  α(d) = 3.8 · (d / 350 km)^0.28,  K(0) = 1,  d ≤ 300 km

R_s is the radiance of source cell s, A_s its area; dividing by the kernel's integral keeps P in nW/cm²/sr. The paper's exponent scale, 2.3, describes the all-sky average; zenith brightness falls off faster, so the scale was refitted to 3.8 on zenith measurements. Each cell is stored as one byte on a logarithmic scale (0.01 to 2,000 nW/cm²/sr, at most 0.052 mag per step); the phone's offline copy is a 6′ block average.

Conversion. The portal rounds the position to 0.001°, interpolates P bilinearly between the four surrounding cells, and sqmFromViirsRadiance computes:

B_art [mcd/m²] = a × P
SQM = −2.5 · log10((B_art + 0.171168465) / 1.08e8)

0.171168465 mcd/m² (naturalSkyLuminance) is a 22.0 mag/arcsec² natural sky, 1.08 × 10⁸ mcd/m² (luminanceZeroPoint) the zero point. The SQM is rounded to 0.01 mag, then classed with the table above. The constant a is 0.299 by default and 0.832 inside a polygon drawn around Japan (skyQualityCalibrationAt). Each answer records source (viirs-vnl-2025), method, calibration (2026-09/global or 2026-09/japan) and estimated: true; the raster's manifest keeps the composite, the kernel parameters and a SHA-256 checksum.

Three synthetic radiances through the same function:

Case P (nW/cm²/sr) a = 0.299: B_art → SQM → Bortle a = 0.832: B_art → SQM → Bortle
City centre 60 17.94 → 16.94 → 9 49.92 → 15.83 → 9
Suburb 20 5.98 → 18.11 → 8 16.64 → 17.02 → 8
Mountain site 1 0.299 → 20.90 → 4 0.832 → 20.08 → 5

Where artificial light dominates, multiplying a by 2.78 brightens the estimate by 1.11 mag; near the natural floor the shift is smaller. The planner shows this estimate for every observing place (features).

Calibrating on Japan's 星空観察 measurements

Twice a year since 2018, the Ministry of the Environment (環境省) runs a national survey, 「デジタルカメラによる夜空の明るさ調査」: a camera with a 35–50 mm lens pointed at the zenith, 30 s at f/5.6 and ISO 800, each frame reduced against standard stars in the same image, results in mag/arcsec² with a scatter indicator (ばらつき). The copy used here holds 3,531 measurements at 1,392 positions from 16 campaigns, summer 2018 to winter 2025.

That is what a regional calibration needs: photometry reduced on stars rather than meters of unknown calibration, one protocol everywhere, repeated visits, and a range from city centres to dark sites (cell medians from 16.56 to 21.74). The model has one free parameter, a, fitted by minimising the RMS residual in magnitudes. The script keeps measurements from 2019 onwards with ばらつき ≤ 0.2 (2,799), takes one median per 2′ cell with at least three readings, and drops cells whose readings disagree by more than 1.5 mag between the 16th and 84th percentiles: 215 cells remain. Residuals, model minus measurement:

Global a = 0.299 Japan a = 0.832
Mean +0.75 mag +0.05 mag
Median +0.67 mag +0.04 mag
Standard deviation 0.35 mag 0.37 mag
RMS 0.83 mag 0.37 mag
Same Bortle class 39 % 76 %
Within one class 87 % 99 %

With the global constant the model reads Japan too dark by a roughly constant factor: +0.88 mag in cells measured brighter than 19, +0.95 between 19 and 20.5, +0.62 between 20.5 and 21.3, +0.35 beyond, where the natural floor dilutes the error. The fit gives a = 0.8323, rounded to 0.832.

Three caveats. The Japan column is in-sample: the constant was fitted on those same cells. The value holds over time: the 2023–2025 campaigns alone (174 cells) give 0.890, a 0.07 mag difference. And the standard deviation does not shrink: the constant removes the offset, not the cell-to-cell scatter, which comes from the limits below.

Camera band and SQM band. Reduced against catalogue stars, the survey's magnitudes are close to the Johnson V band (about 500–600 nm), whereas an SQM integrates a wider visible band; the gap between the two depends on the colour of the sky, and so on the lamps. Globe at Night SQM readings inside the same polygon give a = 0.491 (91 readings, 7 cells, RMS 0.55 mag), but in the global fit the order is reversed (NPS camera 0.201, Globe at Night 0.302), so the band alone does not explain the gap: no colour correction is applied, and in Japan the estimate is in the camera's band.

Limits

The result is a modelled, moonless zenith brightness for a place, not a measurement of any given night.

How to check it

From the repository root:

# rebuild the raster (2025 composite from EOG, free account)
node packages/portal/scripts/prepare-sky-quality-raster.mjs \
  --input VNL_npp_2025_…average_masked.dat.tif.gz \
  --static-data-dir <dir> --work-dir <scratch> \
  --year 2025 --version v2.2 --product average_masked --arcminutes 2
# refit the constants and print the residuals
node packages/portal/scripts/calibrate-sky-quality.mjs \
  --raster-dir <dir>/sky-quality \
  --input nsdmap.geojson --input GaN2019.csv … --input GaN2025.csv \
  --input-japan <survey export> --region japan

--download fetches the NPS and Globe at Night files; the Japanese export is neither in the repository nor downloaded by the script. Run for this article on local copies, the script printed 0.8323 for Japan (215 cells, RMS 0.370, bias +0.048) and a global refit of 0.2954 over 564 sites. The shipped 0.299 was fitted earlier on 486 sites (104 NPS, 382 Globe at Night cells, RMS 0.73 mag), before newer Globe at Night readings were published. Each dataset and its licence is listed under Sources.

To measure your own sky with an SQM:

  1. Clear, moonless night, after astronomical twilight (Sun below −18°).
  2. Away from direct light, meter at ambient temperature, pointed at the zenith.
  3. Five readings; discard the first, keep the median.
  4. Note date, time, cloud cover, and whether the Milky Way is near the zenith.
  5. Repeat on several nights and compare medians.

Entering a measured value for a place is planned in the app: it will replace the estimate there and be labelled as measured. A reading submitted to Globe at Night joins an open dataset any calibration can use.

Sources