usgs

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 10 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 usgs fetches and reads the USGS Spectral Library Version 7: the measured reflectance of minerals, soils, water, plants and made things, from the ultraviolet into the infrared.

The library is a US Geological Survey data release, in the public domain. Work using it cites Kokaly and others, 2017, USGS Spectral Library Version 7 Data, https://doi.org/10.5066/F7RR1WDJ.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() (*celestialdata.Fixed, error)

New is the archive of the library, asked by name only. It holds the library's measured spectra as one archive to fetch, whatever the circle.

Types

type Spectrum

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

Spectrum is one measured reflectance, by wavelength.

func Read

func Read(archive io.ReaderAt, size int64, name string) (*Spectrum, error)

Read is a spectrum from the library's archive, by its name: its file's name without the folder, the prefix or ".txt", as "Seawater_Open_Ocean_SW2_lwch_BECKa_AREF".

Channels with no measurement are left out. It refuses a name the archive does not hold and an instrument it does not know.

func (Spectrum) At

func (spectrum Spectrum) At(nm float64) (float64, bool)

At is the reflectance at a wavelength in nanometres, drawn straight between the channels either side. A channel with no measurement is left out, so the line is drawn across it. There is none outside the measured span, and none for a wavelength that is not a number.

func (Spectrum) Name

func (spectrum Spectrum) Name() string

Name is the spectrum's name as the library gives it.

Jump to

Keyboard shortcuts

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