wcs

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeAffineTransformation added in v0.16.0

func ComputeAffineTransformation(matches []spatial.QuadMatch) (transform.Affine2DParameters, float64, float64, error)

ComputeAffineTransformation computes the affine transformation parameters based on matched quads. It returns the affine parameters and an error if the computation fails.

Types

type CTypeP added in v0.2.0

type CTypeP struct {
	CType1 string
	CType2 string
}

type CoordinateProjectionType added in v0.2.0

type CoordinateProjectionType int
const (
	RADEC_TAN CoordinateProjectionType = iota
	RADEC_TANSIP
)

func (CoordinateProjectionType) ToCTypes added in v0.2.0

func (c CoordinateProjectionType) ToCTypes() CTypeP

type PointPair added in v0.16.0

type PointPair struct {
	X, Y    float64 // Generated Quad NormalisedC and NormalisedD
	RA, Dec float64 // Source Quad SourceRA and SourceDec
}

Each match provides two point correspondences: C and D

type WCS

type WCS struct {
	WCAXES int                              `hdu:"WCAXES" default:"2"`        // Number of world coordinate axes
	CRPIX1 float64                          `hdu:"CRPIX1"`                    // Reference pixel X
	CRPIX2 float64                          `hdu:"CRPIX2"`                    // Reference pixel Y
	CRVAL1 float64                          `hdu:"CRVAL1" default:"0.0"`      // Reference RA (example default, often specific to image)
	CRVAL2 float64                          `hdu:"CRVAL2" default:"0.0"`      // Reference Dec (example default, often specific to image)
	CTYPE1 string                           `hdu:"CTYPE1" default:"RA---TAN"` // Coordinate type for axis 1, typically RA with TAN projection
	CTYPE2 string                           `hdu:"CTYPE2" default:"DEC--TAN"` // Coordinate type for axis 2, typically DEC with TAN projection
	CDELT1 float64                          `hdu:"CDELT1"`                    // Coordinate increment for axis 1 (no default)
	CDELT2 float64                          `hdu:"CDELT2"`                    // Coordinate increment for axis 2 (no default)
	CUNIT1 string                           `hdu:"CUNIT1" default:"deg"`      // Coordinate unit for axis 1, defaulted to degrees
	CUNIT2 string                           `hdu:"CUNIT2" default:"deg"`      // Coordinate unit for axis 2, defaulted to degrees
	CD1_1  float64                          `hdu:"CD1_1"`                     // Affine transform parameter A (no default)
	CD1_2  float64                          `hdu:"CD1_2"`                     // Affine transform parameter B (no default)
	CD2_1  float64                          `hdu:"CD2_1"`                     // Affine transform parameter C (no default)
	CD2_2  float64                          `hdu:"CD2_2"`                     // Affine transform parameter D (no default)
	E      float64                          `hdu:"E"`                         // Affine translation parameter e (optional, no default)
	F      float64                          `hdu:"F"`                         // Affine translation parameter f (optional, no default)
	FSIP   transform.SIP2DForwardParameters ``                                // SIP forward transformation (distortion) coefficients
	ISIP   transform.SIP2DInverseParameters ``                                // SIP inverse transformation (distortion) coefficients
}

func NewWorldCoordinateSystem

func NewWorldCoordinateSystem(xc float64, yc float64, params WCSParams) WCS

NewWorldCoordinateSystem creates a new WCS object with correctly mapped affine parameters.

func (*WCS) EquatorialCoordinateToPixel added in v0.6.0

func (wcs *WCS) EquatorialCoordinateToPixel(
	ra, dec float64,
) (x, y float64)

without iterative removal of SIP distortions.

func (*WCS) PixelToEquatorialCoordinate

func (wcs *WCS) PixelToEquatorialCoordinate(
	x, y float64,
) (coordinate astrometry.ICRSEquatorialCoordinate)

func (*WCS) SolveForCentroid

func (wcs *WCS) SolveForCentroid() (coordinate astrometry.ICRSEquatorialCoordinate)

type WCSParams added in v0.2.0

type WCSParams struct {
	Projection       CoordinateProjectionType         // Projection type e.g., "TAN", or "TAN-SIP"
	AffineParams     transform.Affine2DParameters     // Affine transformation parameters
	ReferenceX       float64                          // Reference X coordinate
	ReferenceY       float64                          // Reference Y coordinate
	SIPForwardParams transform.SIP2DForwardParameters // SIP forward transformation (distortion) coefficients, x, y to RA, Dec
	SIPInverseParams transform.SIP2DInverseParameters // SIP inverse transformation (distortion) coefficients RA, Dec to x, y
}

Jump to

Keyboard shortcuts

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