Documentation
¶
Overview ¶
Package gaia is the library behind the gaia command line: the HTTP client, request shaping, and the typed data models for ESA Gaia DR3.
The Client here is the spine every command shares. It sets a real User-Agent, paces requests so a busy session stays polite, and retries the transient failures (429 and 5xx) that any public service throws under load.
Index ¶
- Constants
- type Client
- func (c *Client) BrightStars(ctx context.Context, maxMag float64, limit int) ([]*Star, error)
- func (c *Client) Get(ctx context.Context, reqURL string) ([]byte, error)
- func (c *Client) NearbyStars(ctx context.Context, ra, dec, radiusDeg float64, limit int) ([]*Star, error)
- func (c *Client) NearestStars(ctx context.Context, limit int) ([]*Star, error)
- func (c *Client) QueryTAP(ctx context.Context, adql string, limit int) ([]map[string]interface{}, error)
- type Domain
- type Star
Constants ¶
const BaseURL = "https://" + Host
BaseURL is the root every request is built from.
const DefaultUserAgent = "gaia-cli/dev (+https://github.com/tamnd/gaia-cli)"
DefaultUserAgent identifies the client to the ESA TAP service.
const Host = "gea.esac.esa.int"
Host is the ESA Gaia TAP server hostname.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
HTTP *http.Client
UserAgent string
// Rate is the minimum gap between requests. Zero means no pacing.
Rate time.Duration
Retries int
// contains filtered or unexported fields
}
Client talks to the ESA Gaia TAP service over HTTP.
func NewClient ¶
func NewClient() *Client
NewClient returns a Client with sensible defaults: 60s timeout (TAP can be slow), 500ms minimum gap between requests, and three retries on transient errors.
func (*Client) BrightStars ¶
BrightStars returns stars brighter than maxMag in the G band, sorted by ascending magnitude (brightest first).
func (*Client) Get ¶
Get fetches a URL and returns the response body. It paces and retries according to the client's settings.
func (*Client) NearbyStars ¶
func (c *Client) NearbyStars(ctx context.Context, ra, dec, radiusDeg float64, limit int) ([]*Star, error)
NearbyStars returns stars within radiusDeg degrees of the given ICRS coordinates.
func (*Client) NearestStars ¶
NearestStars returns the stars with the largest parallax (closest to Earth), filtered to parallax > 100 mas (within ~10 parsecs).
type Domain ¶
type Domain struct{}
Domain is the gaia driver. It carries no state; the per-run client is built by the factory Register hands kit.
func (Domain) Classify ¶
Classify turns any accepted input into the canonical (type, id). For Gaia, any non-empty string is treated as a star source_id.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme, the hostnames a pasted link is matched against, and the identity reused for the binary's help and version.
type Star ¶
type Star struct {
ID string `json:"id" kit:"id"`
RA float64 `json:"ra"`
Dec float64 `json:"dec"`
Parallax float64 `json:"parallax_mas,omitempty"`
ParallaxErr float64 `json:"parallax_error,omitempty"`
MagG float64 `json:"mag_g,omitempty"`
MagBP float64 `json:"mag_bp,omitempty"`
MagRP float64 `json:"mag_rp,omitempty"`
ProperMotRA float64 `json:"pmra,omitempty"`
ProperMotDec float64 `json:"pmdec,omitempty"`
RadialVel float64 `json:"radial_velocity_km_s,omitempty"`
}
Star is a single record from gaiadr3.gaia_source.