layer

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 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 layer lays an image onto the sky's triangles. Each cell of the mesh at the layer's depth takes the mean of the image's pixels whose centres fall in it. The cells are in ICRS whatever frame the image is in. The layer keeps where its image came from.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Refused

func Refused() error

Refused is wrapped by each refusal of this package's own: no image, or an image with no pixel on the sky. Depths the mesh has no room for are refused as the mesh refuses them.

Types

type Layer

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

Layer is an image laid onto the mesh at one depth.

func Lay

func Lay(name string, image *fits.Image, depth int,
	source Source) (*Layer, error)

Lay lays an image onto the mesh at a depth. Each pixel counts in the cell its centre falls in. Pixels that are not a finite number are left out, and so are pixels whose place is off the sky.

It refuses no image, an image whose place on the sky is not read, and an image with no pixel left. Rows cut short are an error.

func (*Layer) At

func (layer *Layer) At(cell mesh.Cell) (Value, bool)

At is the layer's value at a cell. There is none at a cell no pixel fell in, nor at a cell of another depth.

func (*Layer) Cells

func (layer *Layer) Cells() []uint64

Cells are the keys of the cells the layer holds, in order.

func (*Layer) Depth

func (layer *Layer) Depth() int

Depth is the depth of the cells the layer holds.

func (*Layer) Name

func (layer *Layer) Name() string

Name is what the layer is called.

func (*Layer) Source

func (layer *Layer) Source() Source

Source is where the layer's image came from.

type Source

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

Source is where a layer's image came from: its entry in the fetch ledger.

func NewSource

func NewSource(url, licence string, fetched time.Time, size int64,
	sum string) Source

NewSource is a ledger entry. It is where an image was fetched from and the terms it was published under, in the publisher's words. Then come when it was fetched, its length in bytes and its SHA-256 in hex.

func (Source) Fetched

func (from Source) Fetched() time.Time

Fetched is when the image was fetched.

func (Source) Licence

func (from Source) Licence() string

Licence is the terms the image was published under, in the publisher's words.

func (Source) Size

func (from Source) Size() int64

Size is the image's length in bytes.

func (Source) Sum

func (from Source) Sum() string

Sum is the image's SHA-256, in hex.

func (Source) URL

func (from Source) URL() string

URL is where the image was fetched from.

type Value

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

Value is what a layer holds at one cell.

func (Value) Mean

func (held Value) Mean() float64

Mean is the mean of the pixels that fell in the cell.

func (Value) Pixels

func (held Value) Pixels() int

Pixels is how many pixels fell in the cell.

Jump to

Keyboard shortcuts

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