dasch

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 16 Imported by: ? modules, 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 dasch finds the light curves held by the archive at 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.

DR7 serves a light curve only through the Starglass web API, which takes a POST with a JSON body, not an address a GET opens. Its public tier asks for no key.

The API was read on 2026-11-08 from the archive's page on the DR7 web APIs, its page on the data products, Starglass's page on authentication, and daschlab's source (apiclient.py, lightcurves.py, refcat.py), which is Harvard's own client for it.

A search is two questions. The first, querycat, is a box search of the preferred reference catalogue, for the sources round a place; each source has two numbers, ref_number and gsc_bin_index.

The second, lightcurve, takes those and answers with one source's raw light curve: every measure of it, flagged or not. Find asks the first and names a light curve of each source in the circle. Each is a product whose address Lightcurves, a web, answers with the second.

The archive is asked only by name.

Index

Constants

View Source
const Host = "api.starglass.cfa.harvard.edu"

Host is the host the questions go to, in lower case with no dot at its end, as the web package names a host. It is root's host; a test holds the two together.

Variables

View Source
var ErrStopped = errors.New("DASCH is not being asked")

ErrStopped is Starglass not being asked: it asked us to stop, the wait it asked for has not passed, or the circuit is open for this run. The error also holds the *web.Stopped that says which. A fetch of many light curves stops with the first stop.

Functions

func Pages

func Pages() (*celestialdata.Fixed, error)

Pages is the archive of the service's own pages the adapter was built from, asked by name only. They are fetched to be kept as the record of what the adapter was read from, in cited-sources, which .game holds out of every release: they are Harvard's.

func Policy added in v0.0.4

func Policy() (web.Policy, error)

Policy is how Starglass is asked: this package's own numbers, and the web package's defaults for the rest. Hand it to web.NewHosts under Host, and every request to Starglass goes at that pace, stops when Starglass asks it to, and is retried when Starglass says nothing.

Types

type Archive

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

Archive is the archive's DR7 light curves.

func New

func New(doer Doer, agent string, most int) (*Archive, error)

New is DR7's light curves, asked through doer, naming itself to the archive by agent, and naming at most so many sources a circle, the nearest first. It refuses no doer, no agent, and fewer than one source.

func (*Archive) ByNameOnly

func (*Archive) ByNameOnly() bool

ByNameOnly says the archive is asked only when it is named.

func (*Archive) Find

func (archive *Archive) Find(near *celestialdata.Near) (
	[]*celestialdata.Product, error)

Find is the light curve of each of the nearest sources of the circle, at most so many, nearest first. The API's search is of a box; a source in the box's corner, beyond the circle, is left out. A circle wider than the API allows is refused before anything is asked.

func (*Archive) Name

func (archive *Archive) Name() string

Name is the adapter's name as the command line takes it.

type Doer

type Doer interface {
	Do(request *http.Request) (*http.Response, error)
}

Doer is what a question is sent through. An *http.Client is one, and so is what web.Through gives, which is how a run on the network asks: see Policy.

type Lightcurves

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

Lightcurves is a web that asks the archive for a light curve. Asked for a light curve's address, as Find makes it, it sends the question as a POST, which is the only way DR7 gives one.

It opens the answer as the CSV it holds: the first line the names of the columns, then a line a measure. It asks the web under it for anything else unchanged.

func NewLightcurves

func NewLightcurves(under web.Web, doer Doer, agent string) (*Lightcurves,
	error)

NewLightcurves is a web of light curves over under, asking through doer and naming itself to the archive by agent. It refuses no web under it, no doer and no agent.

func (*Lightcurves) Get

func (curves *Lightcurves) Get(address string) (io.ReadCloser, int64,
	error)

Get opens what an address holds. For a light curve's address, that is the light curve, as CSV; it asks the archive once, and no more. An address that is a light curve's but holds no question it takes is an error.

func (*Lightcurves) Head

func (curves *Lightcurves) Head(address string) (int64, error)

Head is the length of what an address holds. A light curve has none until it has been asked for, and asking would be the whole question, so for a light curve it is unsaid.

func (*Lightcurves) Post

func (curves *Lightcurves) Post(address string, form url.Values) (string,
	error)

Post sends a form through the web under it.

Jump to

Keyboard shortcuts

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