Documentation
¶
Overview ¶
Package celestialdata finds and fetches the files astronomy archives hold for a patch of sky. Each archive has its own adapter package. The adapter knows how its archive is laid out and what it holds near a position.
This package holds the parts the adapters share. Fetch brings a product home.
Index ¶
- Constants
- func EndsIn(suffix string) func(link string) bool
- func Fetch(get web.Web, product *Product, into string) (string, error)
- func Refuse(format string, args ...any) error
- func Refused() error
- func Span(value, pixel, step, length float64) (centre, half float64)
- type Adapter
- func (adapter *Adapter) Fail(format string, args ...any) error
- func (adapter *Adapter) Files(folder string, keep func(link string) bool, id, about string) ([]*Product, error)
- func (adapter *Adapter) Footprint() *Patch
- func (adapter *Adapter) Links(folder string) ([]string, error)
- func (adapter *Adapter) Name() string
- func (adapter *Adapter) Product(id, file, url string, size int64, about string) (*Product, error)
- func (adapter *Adapter) Reaches(near *Near) bool
- func (adapter *Adapter) Refuse(format string, args ...any) error
- func (adapter *Adapter) Web() web.Web
- func (adapter *Adapter) Wrap(err error) error
- type Archive
- type ByName
- type Checker
- type File
- type Fixed
- type Frame
- type Galactic
- type Measured
- type Near
- type Patch
- type Position
- type Product
Constants ¶
const Unsized = 0
Unsized is a product's size when the archive does not say it ahead. It's defined: NewProduct takes none as not known.
Variables ¶
This section is empty.
Functions ¶
func EndsIn ¶
EndsIn keeps the links that end in a suffix, as a file's type: EndsIn ".fits" for Files keeps a folder's FITS files.
func Fetch ¶
Fetch brings a product's file into the folder into and returns its path. It makes the folder when it is missing.
It never replaces a file. It refuses when a file is already there under the name. It refuses a .part already there too, since that may be another fetch's.
The bytes go to a .part file of its own first. That file takes the name only once its length is what the server and the product said. For a gzip file the stream must also read to its end. Its own .part is removed when anything fails.
func Refuse ¶
Refuse is a refusal that says why, as fmt.Errorf writes it. It wraps Refused, so the adapters' refusals are found as this package's are.
func Refused ¶
func Refused() error
Refused is wrapped by each of the refusals here. NewProduct and Fetch refuse a name that is not one plain file name. Fetch refuses when a file or a .part is already there under the name.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is the base every archive's adapter is built on: its name, as the command line takes it, the web it asks through, and, for a survey of one part of the sky, its footprint. An adapter holds one, so its products, refusals and errors carry its name without its typing it.
func Named ¶
Named is an adapter by a name with no web of its own, for one that asks through a host it is given or asks nothing. It refuses a name that is not one word.
func NewAdapter ¶
NewAdapter is an adapter by a name, asking through get. It refuses a name that is not one word and a missing web.
func NewField ¶
NewField is an adapter by a name, asking through get, for a survey that covers one part of the sky, patch. A circle that does not reach it is asked nothing. It refuses what NewAdapter does, and a missing patch.
func (*Adapter) Fail ¶
Fail is an error that begins with the adapter's name and says what went wrong, as fmt.Errorf writes it, %w and all.
func (*Adapter) Files ¶
func (adapter *Adapter) Files(folder string, keep func(link string) bool, id, about string) ([]*Product, error)
Files is the files a folder's page lists that keep holds, each as a product of one id and one about. A link that is not one plain file name leads out of the folder; it is not the folder's, and is passed over.
func (*Adapter) Footprint ¶
Footprint is the part of the sky a field covers, or nil for an adapter that is not a field.
func (*Adapter) Links ¶
Links is the links on a folder's page, in the order written, their entities read; an error begins with the adapter's name.
func (*Adapter) Product ¶
Product is one file the archive holds, with the adapter's name for the archive and a few words on what it is, none when about is empty.
id is the archive's own name for what the file belongs to; file is its name, one plain file name; url is where it is kept; size is its length in bytes, Unsized when the archive does not say.
It refuses an empty address, a name that is not one plain file name, and a size below none.
func (*Adapter) Reaches ¶
Reaches is whether a circle reaches a field's footprint. An adapter that is not a field reaches every circle.
func (*Adapter) Refuse ¶
Refuse is a refusal that begins with the adapter's name and says why, as fmt.Errorf writes it. It wraps Refused, as Refuse does.
type Archive ¶
type Archive interface {
// Name is the adapter's name as the command line takes it: one word.
Name() string
// Find is what the archive holds near a position.
Find(near *Near) ([]*Product, error)
}
Archive is one archive's adapter.
type ByName ¶
ByName is an archive that is asked only when it is named, never with every archive. Fixed is one.
type Checker ¶ added in v0.0.3
type Checker interface {
// Check says nothing for a file that is as it should be, or why
// not. path is the file's, before it has the product's name.
Check(path string) error
}
Checker is a check of a fetched file. It is an interface, not a function, so that products stay comparable: a Checker should be a value that can be compared. One that holds a slice or a map compiles, and then == between two products that hold it panics.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File is one file a fixed archive holds, described ahead. NewFile makes one; NewFixed makes it a product.
type Fixed ¶
type Fixed struct {
// contains filtered or unexported fields
}
Fixed is an archive whose files are known ahead, wherever on the sky or the earth they are asked for: a whole-earth image, a library, a map. It is asked only by name, never with every archive, since what it holds does not depend on the circle.
func NewFixed ¶
NewFixed is an archive by a name whose files are described ahead. Each is made a product as Adapter.Product makes one, so an adapter has no refusal of its own to handle. It refuses a name that is not one word, no files, and a file Product refuses.
func (*Fixed) ByNameOnly ¶
ByNameOnly says the archive is asked only when it is named.
type Galactic ¶
type Galactic struct {
// contains filtered or unexported fields
}
Galactic is a place on the sky in galactic longitude and latitude, in degrees.
type Measured ¶
type Measured struct {
// contains filtered or unexported fields
}
Measured is a numbers file an adapter keeps beside its code, read. Its numbers are read from the archive's own files, such as the header cards that say where an image lies.
func NewMeasured ¶
NewMeasured reads a numbers file's bytes. When the file will not read, why is kept and each Get gives it.
func (*Measured) Circle ¶
Circle is the circle three of the numbers name. They are a right ascension, a declination and a radius in degrees. Numbers that are missing are an error. So is a circle that is not one.
func (*Measured) Footprint ¶
Footprint is the patch an image covers in a frame. It is read from the image's header cards. They are kept as numbers named for the image and the card, such as palpha-naxis1.
The first axis is longitude and the second latitude. In ICRS a step along the first axis is a step on the sky. So the reach in right ascension is wider by one over the cosine of the declination.
type Near ¶
type Near struct {
// contains filtered or unexported fields
}
Near is a circle on the sky: a centre and a radius in degrees.
func NewNear ¶
NewNear is the circle of a radius round a centre. It refuses a missing centre, and a radius that is not a size a circle on the sky can have.
func (Near) Reaches ¶
Reaches is whether some of the circle may fall in the patch. It errs only by saying yes.
Each degree of longitude is shorter by the cosine of the latitude. So the circle's reach in longitude is taken where the circle comes nearest a pole. Circles round a pole reach every longitude.
type Patch ¶
type Patch struct {
// contains filtered or unexported fields
}
Patch is a box of sky in a frame. It has a centre and how far it reaches either side of it along each axis. The reach is in that frame's degrees.
func NewPatch ¶
NewPatch is the box round a centre in a frame. It refuses a frame it does not know, a centre off the sky and a reach that is below nothing or not a number.
func (*Patch) Moved ¶
Moved is the same box centred on another longitude, its reach in longitude grown by more. Surveys whose tiles are all one size give each tile's box from one tile's this way.
More below nothing grows it by nothing. Longitudes that are not a number leave a box only circles round a pole reach, as they reach every longitude.
type Position ¶
type Position struct {
// contains filtered or unexported fields
}
Position is a place on the sky, in ICRS degrees.
func NewPosition ¶
NewPosition is the place at a right ascension and declination. It refuses numbers that are not on the sky.
type Product ¶
type Product struct {
// contains filtered or unexported fields
}
Product is one file an archive holds.
func Found ¶
Found is a find of one product, or of none and why. It takes what an adapter's Product gives. So an adapter that names one file hands a refusal on with no branch of its own.
func (*Product) Checked ¶ added in v0.0.3
Checked is the product held to a check of its file: once Fetch has all the bytes, in a file of their own, it gives the check that file's path, and keeps the file only when the check says nothing.
It is for an archive that says no length, whose file can still be told whole by what is in it, or whose file must be the one it found.
It changes the product it is given and gives the same one back, so it is for a product the adapter has just made. A product another has found, such as one from a Fixed archive's Find, is that archive's too: checking it checks it for every later caller.
It gives the product back, or none for none, so a product an adapter's Product refused is handed on with its refusal.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ads asks NASA's Astrophysics Data System for papers, one search a call.
|
Package ads asks NASA's Astrophysics Data System for papers, one search a call. |
|
Package apogee is the adapter for APOGEE DR17's allStar, from the Sloan Digital Sky Survey: one row a star its spectrographs observed in the near infrared, with the parameters and abundances its pipeline, ASPCAP, fit to the star's combined spectrum.
|
Package apogee is the adapter for APOGEE DR17's allStar, from the Sloan Digital Sky Survey: one row a star its spectrographs observed in the near infrared, with the parameters and abundances its pipeline, ASPCAP, fit to the star's combined spectrum. |
|
Package arxiv finds papers on arXiv by their ids and names their PDFs as products to fetch, gently.
|
Package arxiv finds papers on arXiv by their ids and names their PDFs as products to fetch, gently. |
|
Package astronn is the adapter for astroNN's catalogue of APOGEE DR17, from the Sloan Digital Sky Survey: a row for each of allStar's rows, in allStar's order, with what Leung and Bovy's networks read from each spectrum, among them an age, a distance, and an orbit about the Galaxy.
|
Package astronn is the adapter for astroNN's catalogue of APOGEE DR17, from the Sloan Digital Sky Survey: a row for each of allStar's rows, in allStar's order, with what Leung and Bovy's networks read from each spectrum, among them an age, a distance, and an orbit about the Galaxy. |
|
Package bluemarble fetches NASA's Blue Marble Next Generation, the whole earth's land and sea in true colour, a composite of a month of MODIS images, laid on a plain grid of longitude and latitude.
|
Package bluemarble fetches NASA's Blue Marble Next Generation, the whole earth's land and sea in true colour, a composite of a month of MODIS images, laid on a plain grid of longitude and latitude. |
|
Package bsc5 is the adapter for the Yale Bright Star Catalogue, its fifth revised edition (Hoffleit and Warren, 1991): 9,110 rows, the stars a naked eye sees with their J2000 places, V, B-V and spectral types, and fourteen with no place, novae and things found not stars.
|
Package bsc5 is the adapter for the Yale Bright Star Catalogue, its fifth revised edition (Hoffleit and Warren, 1991): 9,110 rows, the stars a naked eye sees with their J2000 places, V, B-V and spectral types, and fourteen with no place, novae and things found not stars. |
|
Package cardiff finds the Hi-GAL PPMAP results kept at Cardiff.
|
Package cardiff finds the Hi-GAL PPMAP results kept at Cardiff. |
|
Package cds names cutouts from the hips2fits service at the Centre de Données astronomiques de Strasbourg.
|
Package cds names cutouts from the hips2fits service at the Centre de Données astronomiques de Strasbourg. |
|
Package chandra finds Chandra's primary data products near a place on the sky.
|
Package chandra finds Chandra's primary data products near a place on the sky. |
|
Package chroma finds the colourways in jane's chroma repository on GitHub: the .css files of its colourways/sources folder, on its main branch.
|
Package chroma finds the colourways in jane's chroma repository on GitHub: the .css files of its colourways/sources folder, on its main branch. |
|
cmd
|
|
|
celestial-data
command
Command celestial-data finds and fetches what astronomy archives hold near a place on the sky.
|
Command celestial-data finds and fetches what astronomy archives hold near a place on the sky. |
|
celestial-data-secrets
command
Command celestial-data-secrets keeps the secrets celestial-data signs in with, in one place.
|
Command celestial-data-secrets keeps the secrets celestial-data signs in with, in one place. |
|
Package dasch finds the light curves DASCH holds of a place on the sky: Harvard's Digital Access to a Sky Century @ Harvard, the photographic plates of the Harvard College Observatory, 1880s to 1989, scanned and measured; its final release is DR7.
|
Package dasch finds the light curves DASCH holds of a place on the sky: Harvard's Digital Access to a Sky Century @ Harvard, the photographic plates of the Harvard College Observatory, 1880s to 1989, scanned and measured; its final release is DR7. |
|
Package gaia is the adapter for ESA's Gaia archive: rows of Gaia DR3's gaia_source, as FITS, asked as a job of the archive's TAP service.
|
Package gaia is the adapter for ESA's Gaia archive: rows of Gaia DR3's gaia_source, as FITS, asked as a job of the archive's TAP service. |
|
Package galah is the adapter for GALAH DR4's allstar, from Data Central: one row a star the GALAH survey observed with HERMES on the Anglo-Australian Telescope, with the parameters and abundances its pipeline fit, lithium among them.
|
Package galah is the adapter for GALAH DR4's allstar, from Data Central: one row a star the GALAH survey observed with HERMES on the Anglo-Australian Telescope, with the parameters and abundances its pipeline fit, lithium among them. |
|
Package horizons asks JPL's Horizons system where the sun, the earth and the moon stand as seen from the James Webb Space Telescope at one moment: 20:53 on 2027-05-22, when the star Gaia DR3 4081136684118965760 reaches the edge of where Webb may point.
|
Package horizons asks JPL's Horizons system where the sun, the earth and the moon stand as seen from the James Webb Space Telescope at one moment: 20:53 on 2027-05-22, when the star Gaia DR3 4081136684118965760 reaches the edge of where Webb may point. |
|
internal
|
|
|
caom
Package caom asks MAST's API about the observations it keeps in its Common Archive Observation Model: those whose footprint meets a circle, and the files of each.
|
Package caom asks MAST's API about the observations it keeps in its Common Archive Observation Model: those whose footprint meets a circle, and the files of each. |
|
fitstest
Package fitstest writes the FITS files the survey readers are tested on: a primary array of nothing, then one binary table of the columns and rows a test lays out, as the FITS Standard 4.0 lays them.
|
Package fitstest writes the FITS files the survey readers are tested on: a primary array of nothing, then one binary table of the columns and rows a test lays out, as the FITS Standard 4.0 lays them. |
|
must
Package must holds what a package makes once, at start-up, from its own declarations: a value that can only fail if the package itself is wrong, which its tests then find.
|
Package must holds what a package makes once, at start-up, from its own declarations: a value that can only fail if the package itself is wrong, which its tests then find. |
|
replay
Package replay answers an adapter's questions with what an archive really said.
|
Package replay answers an adapter's questions with what an archive really said. |
|
rows
Package rows is what the catalogue readers share as they read a row: a refusal that names what it refuses and wraps why, and a place on the sky from a row's degrees.
|
Package rows is what the catalogue readers share as they read a row: a refusal that names what it refuses and wraps why, and a place on the sky from a row's degrees. |
|
Package irsa finds what NASA's infrared archive at IPAC holds near a place on the sky.
|
Package irsa finds what NASA's infrared archive at IPAC holds near a place on the sky. |
|
Package k2 finds what Kepler's second mission, K2, holds of a place on the sky, as MAST keeps it: the light curves and target pixel files of the stars it watched there, and the full-frame images of each campaign whose field holds the place, each fetched as a FITS file.
|
Package k2 finds what Kepler's second mission, K2, holds of a place on the sky, as MAST keeps it: the light curves and target pixel files of the stars it watched there, and the full-frame images of each campaign whose field holds the place, each fetched as a FITS file. |
|
Package keck finds the Keck Observatory Archive's HIRES spectra near a place on the sky: each public science frame whose pointing falls in the circle, and the spectra KOA extracted from it with MAKEE, one a CCD, where it has them.
|
Package keck finds the Keck Observatory Archive's HIRES spectra near a place on the sky: each public science frame whose pointing falls in the circle, and the spectra KOA extracted from it with MAKEE, one a CCD, where it has them. |
|
Package lamost finds LAMOST's spectra near a place on the sky: those of DR10 v2.0, public to all since September 2024, at low resolution and at medium.
|
Package lamost finds LAMOST's spectra near a place on the sky: those of DR10 v2.0, public to all since September 2024, at low resolution and at medium. |
|
Package mast finds the files of the HST/NICMOS Paschen-alpha survey of the Galactic Centre.
|
Package mast finds the files of the HST/NICMOS Paschen-alpha survey of the Galactic Centre. |
|
Package naturalearth fetches and reads Natural Earth's land: the outlines of the land at a scale of 1:50 million, as GeoJSON.
|
Package naturalearth fetches and reads Natural Earth's land: the outlines of the land at a scale of 1:50 million, as GeoJSON. |
|
Package nustar finds NuSTAR's cleaned event files near a place on the sky.
|
Package nustar finds NuSTAR's cleaned event files near a place on the sky. |
|
Package plates finds the photographic sky-survey plates that cover a place on the sky: for a circle, a cutout from each survey STScI's Digitized Sky Survey serves there, as a FITS file with the plate's header cards as the scan left them.
|
Package plates finds the photographic sky-survey plates that cover a place on the sky: for a circle, a cutout from each survey STScI's Digitized Sky Survey serves there, as a FITS file with the plate's header cards as the scan left them. |
|
Package sarao finds the files of SARAO's MeerKAT mosaic of the Galactic Centre: its total intensity at 1.28 GHz, its spectral index and that index's error.
|
Package sarao finds the files of SARAO's MeerKAT mosaic of the Galactic Centre: its total intensity at 1.28 GHz, its spectral index and that index's error. |
|
Package sdssv finds SDSS-V's optical spectra near a place on the sky: the BOSS spectra of DR19 that SkyServer's spAll table lists, each a FITS file on the Science Archive Server.
|
Package sdssv finds SDSS-V's optical spectra near a place on the sky: the BOSS spectra of DR19 that SkyServer's spAll table lists, each a FITS file on the Science Archive Server. |
|
Package secrets is the one place celestial-data knows its secrets: each service it signs in to, the fields that service's secret has, and where in 1Password the person who runs it keeps that secret.
|
Package secrets is the one place celestial-data knows its secrets: each service it signs in to, the fields that service's secret has, and where in 1Password the person who runs it keeps that secret. |
|
Package skyview asks NASA's SkyView for whole-sky maps: any of its surveys resampled onto one image of the sky in galactic longitude and latitude, on a plain grid, as FITS.
|
Package skyview asks NASA's SkyView for whole-sky maps: any of its surveys resampled onto one image of the sky in galactic longitude and latitude, on a plain grid, as FITS. |
|
Package soniakeys fetches test files of Sonia Keys's Go implementation of Meeus's Astronomical Algorithms (github.com/soniakeys/meeus, MIT licence), at the one commit celestial cites, bfbd9ac.
|
Package soniakeys fetches test files of Sonia Keys's Go implementation of Meeus's Astronomical Algorithms (github.com/soniakeys/meeus, MIT licence), at the one commit celestial cites, bfbd9ac. |
|
Package spherex finds the images NASA's SPHEREx mission has taken of a place on the sky, as IRSA holds them, and names a cutout of each: a small multi-extension FITS file round the circle's centre.
|
Package spherex finds the images NASA's SPHEREx mission has taken of a place on the sky, as IRSA holds them, and names a cutout of each: a small multi-extension FITS file round the circle's centre. |
|
Package starhorse is the adapter for StarHorse's APOGEE DR17 and Gaia EDR3 results (Queiroz et al.
|
Package starhorse is the adapter for StarHorse's APOGEE DR17 and Gaia EDR3 results (Queiroz et al. |
|
Package tap asks a Table Access Protocol service one question in ADQL and waits for the answer.
|
Package tap asks a Table Access Protocol service one question in ADQL and waits for the answer. |
|
Package tess finds TESS's light curves of a place on the sky, as MAST keeps them: those the mission made and those of its high level science products, QLP's among them, each fetched as a FITS file.
|
Package tess finds TESS's light curves of a place on the sky, as MAST keeps them: those the mission made and those of its high level science products, QLP's among them, each fetched as a FITS file. |
|
Package usgs fetches and reads the USGS Spectral Library Version 7: the measured reflectance of minerals, soils, water, plants and made things, from the ultraviolet into the infrared.
|
Package usgs fetches and reads the USGS Spectral Library Version 7: the measured reflectance of minerals, soils, water, plants and made things, from the ultraviolet into the infrared. |
|
Package usno fetches pages the US Naval Observatory's Astronomical Applications Department publishes, which celestial reads its formulas from: first, its approximate solar coordinates, the sun's place to about an arcminute within two centuries of 2000.
|
Package usno fetches pages the US Naval Observatory's Astronomical Applications Department publishes, which celestial reads its formulas from: first, its approximate solar coordinates, the sun's place to about an arcminute within two centuries of 2000. |
|
Package votable reads a VOTable.
|
Package votable reads a VOTable. |
|
Package web is the one way celestial-data reaches an archive: a GET, a HEAD and a POST.
|
Package web is the one way celestial-data reaches an archive: a GET, a HEAD and a POST. |