spectrum

package
v0.0.4 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: 12 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 spectrum measures a star's light in the SPHEREx cutouts the spherex archive fetched, one wavelength an image: together they are the star's spectrum from 0.75 to 5 microns.

Each cutout is measured by forced photometry at the star's Gaia place, moved by its proper motion to the image's time, with the cutout's own effective point-spread function nearest the star.

The background and the cutout's other peaks are fitted beside the star; a neighbour left out lends its light to it.

It reads files and asks no one. A QR2 cutout carries the older PSF cube and no ePSF, and its fluxes are on QR2's gain, so it is refused, saying so, until SPHEREx's calibration files are fetched.

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.

func Write

func Write(out io.Writer, points []Point) error

Write writes points as a table: a line of the columns after a #, then a point a line, the wavelength rising, each value tab apart.

Types

type Measure

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

Measure is the measure of a star in SPHEREx cutouts, by the numbers in numbers.yaml.

func New

func New() (*Measure, error)

New is the measure, its numbers read from numbers.yaml. It refuses a numbers file that does not read or lacks a number.

func (*Measure) Cutout

func (measure *Measure) Cutout(path string, star Star) (*Point, error)

Cutout is the star measured in one cutout. It refuses a file that is not a SPHEREx cutout as the user guide lays one out, a QR2 cutout, a star the cutout does not hold, and a fit past solving.

func (*Measure) Folder

func (measure *Measure) Folder(folder string, star Star) ([]Point,
	[]error, error)

Folder is the star measured in every FITS file in a folder, in the files' order by name, and why each file it could not measure was refused. It refuses a folder it cannot list.

type Point

type Point struct {
	Wavelength, Bandwidth    float64
	Flux, Error, Statistical float64
	Background               float64
	ChiSquared               float64
	Used                     int
	Quality                  float64
	Flags                    int64
	Neighbours               int
	MJD                      float64
	Detector                 int
	X, Y                     float64
	SolidAngle               float64
	File                     string
}

Point is a star's light in one cutout: the wavelength and bandwidth in microns where the cutout saw it, and its flux in micro-Jy with the systematic share added to its error, and without it.

The rest say how the fit went: the background a pixel, in MJy/sr; the chi-squared a degree of freedom over the pixels used; the quality over the star's circle; the flags of the pixels in that circle; the neighbours fitted beside it.

And where: the image's time, its detector, the star's place in the cutout counted from the first pixel's centre, a pixel's solid angle there in square arcseconds, and the file.

type Star

type Star struct {
	RA, Dec     float64
	PMRA, PMDec float64
	Epoch       float64
}

Star is where a star is, as Gaia gives it: its place in degrees at its epoch, a Julian year, and its proper motion in milliarcseconds a year, the one in right ascension along the sky, as Gaia's pmra is.

Jump to

Keyboard shortcuts

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