eaprm

package module
v0.0.0-...-13f27bc Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package eaprm contains helper functions for emprical air pollution regression modeling.

Index

Constants

View Source
const (
	PrimaryPM25 = "PrimaryPM25"
	PNH4        = "pNH4"
	PNO3        = "pNO3"
	PSO4        = "pSO4"
	SOA         = "SOA"
)

These are the pollutants accepted in the InMAP SR matrix.

Variables

View Source
var Segments = 20

Segments is the number of line segments used to represent a circular buffer. See github.com/ctessum/geom.Point.Buffer for more information.

Functions

func Hour

func Hour(t []time.Time) [][]float64

Hour returns a two dimensional array of 1 or zero values, where the first dimension of the array is of length 24 and corresponds to the hours of the day, and the second dimension of the array is the same length as t. Values in the returned array [i,j] will be 1 if the hour of day in t[j] equals i, and zero otherwise.

func Month

func Month(t []time.Time) [][]float64

Month returns a two dimensional array of 1 or zero values, where the first dimension of the array is of length 12 and corresponds to the months of the year, and the second dimension of the array is the same length as t. Values in the returned array [i,j] will be 1 if the month in t[j] equals i, and zero otherwise. January is month 0.

func Normalize

func Normalize(d []float64) []float64

Normalize transforms d so that its mean is zero and its standard deviation is one.

func Weekend

func Weekend(t []time.Time) []float64

Weekend returns an array of 1 or zero values, with 1 values for members of t that are on a weekend (i.e., Saturday or Sunday) and zero otherwise.

func Year

func Year(t []time.Time, start, end int) ([][]float64, error)

Year returns a two dimensional array of 1 or zero values, where the first dimension of the array is of length (end - start), where start and end are the first and last years considered, and corresponds to the year, and the second dimension of the array is the same length as t. Values in the returned array [i,j] will be 1 if the year in t[j] equals i, and zero otherwise.

Types

type FeatureFunc

type FeatureFunc func([]*osm.GeomTags, []geom.Point) ([]float64, error)

FeatureFunc is a class of functions that takes and array of OpenStreetMap features and and array of points to relate them to and returns a relation between all of the features and each of the points.

func Buffer

func Buffer(radius float64) FeatureFunc

Buffer returns a FeatureFunc that sums the count (for point features), length (for linear features), or area (for polygonal features) of a group of features within the given radius (in degrees) of each of the point locations of interest.

func InMAP

func InMAP(r *sr.Reader, pol InMAPPol) FeatureFunc

InMAP returns a FeatureFunc that calculates PM2.5 concentrations at each point of interest caused by ground-level emissions from a group of features, where each feature emits at a rate equal to 1 for point features, the feature length for line features, and the feature area for polygon features.

type InMAPPol

type InMAPPol string

InMAPPol represents pollutant names in the InMAP SR matrix.

type OSM

type OSM struct {
	// contains filtered or unexported fields
}

OSM extracts information from an OpenStreetMap database.

func NewOSM

func NewOSM(f io.ReadSeeker) *OSM

NewOSM creates a new OSM object where f is a connection to an OpenStreetMap database.

Jump to

Keyboard shortcuts

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