refractiveindex

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: 8 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 refractiveindex fetches and reads the refractiveindex.info database: optical constants of thousands of materials, their refractive index n and extinction coefficient k by wavelength.

The measurements span the ultraviolet into the infrared. Mikhail Polyanskiy keeps the database; each material is a book on a shelf, and each page is one measurement by the researchers who made it.

The database is in the public domain: copyright and related rights were waived through the CC0 1.0 Universal Public Domain Dedication.

Work using it cites Polyanskiy, M. N. Refractiveindex.info database of optical constants. Scientific Data 11, 94 (2024), doi 10.1038/s41597-023-02898-2, and the original publications behind the specific datasets it uses; those are each data file's references.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

New is the database's archive, asked by name only. It holds the one release zip, held to its size and to the sum of its bytes.

Types

type Row

type Row struct {
	Micrometres float64
	N           float64
	K           float64
}

Row is one wavelength's optical constants. K is zero for a page that tabulates only n: such a page gives no k at all, and none is drawn from it, so zero stands for none.

type Table

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

Table is one page's optical constants: what the page's data file says of itself, and its rows.

func Read

func Read(archive io.ReaderAt, size int64, shelf, book, page string) (
	Table, error)

Read is a page of a book on a shelf, read from the database's archive by the names the catalog takes: shelf, book and page, as "main", "Au" and "Johnson".

It refuses a shelf, book or page the catalog does not hold, by name, and a page whose constants are a formula or anything but tabulated n and k, by name.

func (Table) Comments

func (table Table) Comments() string

Comments is the page's comments section: what else its file says of its numbers, or the empty string when it says none.

func (Table) References

func (table Table) References() string

References is the page's references section: the publications the page asks to be cited for its numbers.

func (Table) Rows

func (table Table) Rows() []Row

Rows is the page's constants, a wavelength each, in the file's order.

Jump to

Keyboard shortcuts

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