psf

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 1 package

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 psf is forced photometry: the light of stars at places already known, fitted in small tiles of an image together with the background. Each star's light falls on the pixels as its effective point-spread function says, the share of a star's light each pixel records.

A Shape is that function, sampled finer than the pixels, as SPHEREx and Hubble publish theirs. A Tile is a few pixels about the stars, with each pixel's variance. Fit solves a batch of tiles, each apart, for each star's light and the background under them.

The places are held, not fitted, so each tile is one weighted linear least-squares solve. Every star near enough to give light to a tile belongs in it; a star left out lends its light to the others.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Refused

func Refused() error

Refused is the error every refusal wraps, for errors.Is.

Types

type Fitted

type Fitted struct {
	Fluxes, Errors              []float64
	Background, BackgroundError float64
	Used                        int
	ChiSquared                  float64
	Err                         error
}

Fitted is what a tile's fit found: each star's light, in the pixels' unit summed over every pixel, and its error; the background, a pixel's worth, and its error; how many pixels the fit used, and its chi-squared over them.

Err is why a tile was refused, and the rest is then empty.

func Fit

func Fit(tiles []Tile) []Fitted

Fit is each tile's fit, in the tiles' order. Each tile is solved apart from the others, so one refused leaves the rest whole.

type Shape

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

Shape is an effective point-spread function: the share of a star's light a pixel records, by where the pixel's centre lies from the star, sampled over times finer than the pixels each way.

func ShapeOf

func ShapeOf(samples []float64, side, over int) (*Shape, error)

ShapeOf is a shape from its samples: side by side of them, x varying fastest, then y, over samples to a pixel each way, the star at the middle sample. The samples are scaled to sum to one, so a star's light is whole however the publisher normalised them.

It refuses an even side, which has no middle sample, and a side of under three, which cannot be interpolated. It refuses an oversampling below one, samples that do not fill the side, a sample that is not a number, and samples that sum to none or less.

A sample below none is kept: a measured shape may dip there in its wings.

func (*Shape) Reach

func (shape *Shape) Reach() float64

Reach is how far from the star, in pixels along either axis, the shape gives any pixel light: past it every share is none.

func (*Shape) Share

func (shape *Shape) Share(dx, dy float64) float64

Share is the share of the star's light a pixel records whose centre lies dx and dy pixels from the star: the samples interpolated there, times the samples a pixel holds. The shares over every pixel the shape reaches sum to near one. Past the samples it is none.

type Star

type Star struct {
	X, Y  float64
	Shape *Shape
}

Star is a star at a place known before the fit, and its shape there. The place is in the tile's pixels: the first pixel's centre is at x 0, y 0, x counting across a row and y up the rows.

type Tile

type Tile struct {
	Width, Height int
	Pixels        []float64
	Variance      []float64
	Ignored       []bool
	Stars         []Star
}

Tile is a few pixels of an image about some stars: each pixel's value and its variance, row by row from y 0 with x varying fastest, and the pixels the fit leaves out. Ignored may be nil, leaving none out.

Jump to

Keyboard shortcuts

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