Skip to main content

sqm_to_bortle_class

Converts a Zenith Sky Quality Meter (SQM) reading to a Bortle class.
def sqm_to_bortle_class(sqm: float) -> int

Parameters

sqm
float
required
The sky brightness in mag/arcsec²

Returns

bortle_class
int
The integer Bortle class (1=Excellent Dark Sky, 9=Inner City)

Bortle Class Thresholds

The function uses the following SQM thresholds to determine Bortle classes:
Bortle ClassSQM Range (mag/arcsec²)Sky Condition
1≥ 21.99Excellent dark-sky site
221.89 - 21.98Typical dark site
321.69 - 21.88Rural sky
420.49 - 21.68Rural/suburban transition
519.50 - 20.48Suburban sky
618.94 - 19.49Bright suburban sky
718.38 - 18.93Suburban/urban transition
817.80 - 18.37City sky
9< 17.80Inner-city sky

Example

from light_pollution.bortle import sqm_to_bortle_class

# Excellent dark sky
bortle = sqm_to_bortle_class(22.0)
print(bortle)  # Output: 1

# Suburban sky
bortle = sqm_to_bortle_class(19.8)
print(bortle)  # Output: 5

# Inner city
bortle = sqm_to_bortle_class(17.5)
print(bortle)  # Output: 9

Build docs developers (and LLMs) love