Documentation ¶
Index ¶
- func CreateMask(width int32, radius float32) []int32
- func Dist2D(a, b Point2D) float32
- func Dist2DSquared(a, b Point2D) float32
- func Dist3D(a, b Point3D) float32
- func Dist3DSquared(a, b Point3D) float32
- func PrintStars(w io.Writer, stars []Star)
- func QPartitionStarsDesc(a []Star) int
- func QSortStarsDesc(a []Star)
- type Aligner
- type KDTree2
- type KDTree3P
- type Match
- type Point2D
- type Point3D
- type Point3DPayload
- type Rect2D
- type Star
- type Transform2D
- type Triangle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMask ¶
Creates a mask of given radius. Returns a list of index offsets
func Dist2DSquared ¶
Returns the squared euclididian distance between the two given points
func Dist3DSquared ¶
Returns the squared euclididian distance between the two given points
func QPartitionStarsDesc ¶
Partitions an array of stars with the middle pivot element, and returns the pivot index. Values greater than the pivot are moved left of the pivot, those less are moved right. Array must not contain IEEE NaN
func QSortStarsDesc ¶
func QSortStarsDesc(a []Star)
Sort an array of stars in descending order, based on mass Array must not contain IEEE NaN
Types ¶
type Aligner ¶
type Aligner struct { Naxisn []int32 // Size of the destination image we are aligning to RefStars []Star // The reference stars this aligner uses Stars2DT KDTree2 // Pointerless 2-dimensional tree for fast lookup of reference stars RefTriangles []Triangle // Reference triangles built from the above, using the k constant RefTri3DT KDTree3P // Pointerless 3-dimensional tree for fast lookup of reference triangles K int32 // Consider top k brightest stars for building triangles }
A star aligner
func NewAligner ¶
Creates a new star aligner from the given reference stars and priming constant k
type KDTree2 ¶
type KDTree2 []Point2D
A kd-Tree with k=2 dimensions. Inspired by https://en.wikipedia.org/wiki/K-d_tree Pointerless idea came up by itself ;)
type KDTree3P ¶
type KDTree3P []Point3DPayload
A kd-Tree with k=3 dimensions and payload. Inspired by https://en.wikipedia.org/wiki/K-d_tree Pointerless idea came up by itself ;)
func (KDTree3P) Make ¶
func (points KDTree3P) Make()
Builds a pointerless k-dimensional tree with k=3 from the points by resorting the array. Function for mod 3 == 0 depths which pivots on the X dimension.
func (KDTree3P) NearestNeighbor ¶
func (kdt KDTree3P) NearestNeighbor(p Point3D) (closestPt Point3DPayload, closestDsq float32)
Performs a nearest neighbor search on the points, which must have been previously transformed to a k-dimensional tree using NewKDTree3P()
type Match ¶
A candidate match between a triangle and a reference triangle, with distance between them
type Point3DPayload ¶
type Point3DPayload struct { Point3D Payload interface{} }
A 3-dimensional point with floating point coordinates and payload
type Star ¶
type Star struct { Index int32 // Index of the star in the data array. int32(x)+width*int32(y) Value float32 // Value of the star in the data array. data[index] X float32 // Precise star x position via center of mass Y float32 // Precise star y position via center of mass Mass float32 // Star mass. Summed pixel values above location estimate, within given radius HFR float32 // Half-Flux Radius of the star, in pixels }
A star, as found on an image by star detection
func FindStars ¶
func FindStars(data []float32, width int32, location, scale, starSig, bpSigma, starInOut float32, radius int32, medianDiffStats *stats.Stats) (stars []Star, sumOfShifts, avgHFR float32)
Find stars in the given image with data type int16
func (*Star) Dimensions ¶
Adapter method 1 to make Star work with KD-Tree
type Transform2D ¶
A 2D coordinate transformation.
func IdentityTransform2D ¶
func IdentityTransform2D() Transform2D
func NewTransform2D ¶
func NewTransform2D(p1, p2, p3, p1p, p2p, p3p Point2D) (Transform2D, error)
Calculate 2D transformation matrix from three given points in first coordinate system, and corresponding reference points in second coordinate system. p1, p2, p3 are in the first system. p1p, p2p, p3p are in the second.
func (*Transform2D) Apply ¶
func (t *Transform2D) Apply(p Point2D) (pP Point2D)
Apply given 2D transformation to the given coordinates
func (*Transform2D) ApplySlice ¶
func (t *Transform2D) ApplySlice(ps []Point2D) (pPs []Point2D)
Apply given 2D transformation to many given coordinates
func (*Transform2D) Invert ¶
func (t *Transform2D) Invert() (inv Transform2D, err error)
Invert a given 2D transformation. Returns error in the case of divid
func (Transform2D) String ¶
func (t Transform2D) String() string