goaqi

package module
v0.0.0-...-eea2d5b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2022 License: MIT Imports: 2 Imported by: 0

README

goaqi is a go library to compute air quality index (AQI) from air pollutants concentrations.

AirNow Technical Assistance Document for the Reporting of Daily Air Quality – the Air Quality Index (AQI)

Meta

Michael Peters - michael@michaelpeterswa.com

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// PM25Breakpoints are the breakpoints for PM2.5 in µg/m3
	PM25Breakpoints = []Breakpoint{
		{0, 12.0},
		{12.1, 35.4},
		{35.5, 55.4},
		{55.5, 150.4},
		{150.5, 250.4},
		{250.5, 350.4},
		{350.5, 500.4},
	}
	// PM10Breakpoints are the breakpoints for PM10 in µg/m3
	PM100Breakpoints = []Breakpoint{
		{0, 54},
		{55, 154},
		{155, 254},
		{255, 354},
		{355, 424},
		{425, 504},
		{505, 604},
	}
	// AQIBreakpoints are the breakpoints for AQI
	AQIBreakpoints = []Breakpoint{
		{0, 50},
		{51, 100},
		{101, 150},
		{151, 200},
		{201, 300},
		{301, 400},
		{401, 500},
	}

	// AQI Name Designations
	AQIDesignations = []string{
		"Good",
		"Moderate",
		"Unhealthy for Sensitive Groups",
		"Unhealthy",
		"Very Unhealthy",
		"Hazardous",
		"Hazardous",
	}

	ErrBeyondTheScale = errors.New("beyond the scale")
)

Functions

func AQIDesignationFromIndex

func AQIDesignationFromIndex(aqi int64) (string, error)

func AQIPM100

func AQIPM100(avg float64) (int64, error)

AQIPM100 calculates the AQI for PM10.0

Requires a 24 hour average of PM10.0 concentration in µg/m3

func AQIPM25

func AQIPM25(avg float64) (int64, error)

AQIPM25 calculates the AQI for PM2.5

Requires a 24 hour average of PM2.5 concentration in µg/m3

Please note that the truncation step is not performed in this function

Types

type Breakpoint

type Breakpoint struct {
	Low  float64
	High float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL