atmosphere

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package atmosphere is the earth's air worked out from what it is and how it lies: its temperature, pressure and density by height, and in time what it does to light along a path. nothing in it is a colour picked by eye, and every number names its source.

Package atmosphere is built on measure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrHeight

func ErrHeight() error

ErrHeight is a height the standard does not reach: below sea level or above its top, at 86 km.

func ErrWavelength

func ErrWavelength() error

ErrWavelength is a wavelength outside the range peck and reeder's refractive index of air holds over.

func ErrWay

func ErrWay() error

ErrWay is a way that points nowhere: no length, or parts that are not numbers.

Types

type Air

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

Air is the air at one place: how warm it is, how hard it presses and how much of it there is.

func Standard

func Standard(height measure.Length) (*Air, error)

Standard is the 1976 standard air at a height above sea level, from sea level to 86 km. It refuses a height outside that, and then gives no air.

func (Air) Density

func (air Air) Density() Density

Density is how much air there is in a volume.

func (Air) Pressure

func (air Air) Pressure() Pressure

Pressure is how hard the air presses.

func (Air) Temperature

func (air Air) Temperature() measure.Temperature

Temperature is how warm the air is.

type Column

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

Column is the air along a way: how many molecules stand on each square metre across it, and whether the way ends on the ground.

func Along

func Along(height measure.Length, rise measure.Angle) (*Column, error)

Along is the air along a straight way from a height above sea level, rising at an angle above level: out to the standard's top, or down to the ground. Light bends on such a way, and that is not here yet. It refuses a height outside the standard, and then gives no column.

func (Column) Grounded

func (column Column) Grounded() bool

Grounded is whether the way ends on the ground, not in space.

func (Column) Molecules

func (column Column) Molecules() float64

Molecules is how many molecules of air stand on each square metre across the way.

type Composition

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

Composition is dry air with some share of co2, its other gases as bodhaine and the others' table 1 has them by volume.

func DryAir

func DryAir(partsAMillion float64) (*Composition, error)

DryAir is dry air of so many parts a million of co2. It refuses a share below nothing or above all the air, and then gives no air.

func (Composition) CrossSection

func (air Composition) CrossSection(wavelength measure.Length) (
	*measure.Area, error)

CrossSection is how much light of a wavelength one molecule of the air scatters, as an area: bodhaine and the others' equation 22. It refuses a wavelength outside what the refractive index holds over, and then gives no area.

func (Composition) Depth

func (air Composition) Depth(column Column, wavelength measure.Length) (
	float64, error)

Depth is a column's rayleigh optical depth at a wavelength: how many times over its light is scattered on the way. It refuses what CrossSection refuses, and then gives nothing.

func (Composition) DepthAbove

func (air Composition) DepthAbove(wavelength measure.Length,
	pressure Pressure, latitude measure.Angle,
	height measure.Length) (float64, error)

DepthAbove is the rayleigh optical depth of the air above a place: how many times over the light of a wavelength coming straight down is scattered on its way, bodhaine and the others' equation 25.

The pressure is the place's. Gravity is taken at the column's mass-weighted height, their equation 26. DepthAbove refuses what CrossSection refuses, and then gives nothing.

func (Composition) Skylight

func (air Composition) Skylight(height measure.Length, view, sun Way,
	wavelengths []measure.Length) ([]float64, error)

Skylight is the light the sky sends down a look from a height, at each wavelength, for each watt a square metre of sunlight from the sun's way: a radiance, in watts a square metre a steradian.

It is single scattering. Sunlight comes down through the air to each step of the look, and rayleigh's phase function for unpolarised light turns a share of it toward the eye. The air between takes its share on the way, and a step the earth hides from the sun sends nothing.

Not here: light scattered twice or more, the ground's light, haze, ozone, the bending of light, and the air's depolarisation, which changes the phase function by under one and a half percent.

Skylight refuses a height outside the standard and a wavelength CrossSection refuses, and then gives no light.

func (Composition) Through

func (air Composition) Through(column Column, wavelength measure.Length) (
	float64, error)

Through is how much of the light of a wavelength gets through a column, by beer and lambert. It refuses what CrossSection refuses, and then gives nothing.

type Density

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

Density is mass in a volume.

func (Density) InKilogramsPerCubicMetre

func (density Density) InKilogramsPerCubicMetre() float64

InKilogramsPerCubicMetre is the density in kilograms a cubic metre.

type Pressure

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

Pressure is a pressure.

func Pascals

func Pascals(amount float64) Pressure

Pascals is a pressure in pascals.

func (Pressure) InPascals

func (pressure Pressure) InPascals() float64

InPascals is the pressure in pascals.

type Way

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

Way is a direction from where the sky is seen: y is up, and x and z lie level.

func NewWay

func NewWay(x, y, z float64) (*Way, error)

NewWay is the direction of three parts. It refuses parts that point nowhere, and then gives no way.

Jump to

Keyboard shortcuts

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