Skip to content

omnilab/jpl API reference

Floor
Provider · Omnilab
Version
1.x
Conformance suite
not wired
Verified for real
Its README does not say
Licence
MIT
composer require omnilab/jpl:1.x-dev

Read from the package's own PHP files at the commit b3117dc27b83: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnilab\Jpl

  • JplSource class

    JPL's Small-Body Database (ssd-api.jpl.nasa.gov): an asteroid or a comet by its designation, its number or its name (433, Eros, 101955 Bennu, 1P, 2004 MN4); its orbit - the elements at their epoch with their uncertainties, the period, the MOIDs -, its physical parameters (absolute magnitude, diameter, albedo, rotation period, density, spectral types), whether it is a near-Earth object and a potentially hazardous one, its discovery and the IAU citation of its name, its close approaches to the Earth and, when Sentry follows it, its impact risk; a search by name or designation (the SBDB Query API).

    5 methods · 2 constants

  • JplSourceFactory class

    JPL's Small-Body Database: asteroids and comets, their orbits, physical parameters, close approaches to the Earth and impact risk - no key needed.

    4 options

Omnilab\Jpl

JplSource class

final class JplSource extends HttpSource JplSource.php:36

JPL's Small-Body Database (ssd-api.jpl.nasa.gov): an asteroid or a comet by its designation, its number or its name (433, Eros, 101955 Bennu, 1P, 2004 MN4); its orbit - the elements at their epoch with their uncertainties, the period, the MOIDs -, its physical parameters (absolute magnitude, diameter, albedo, rotation period, density, spectral types), whether it is a near-Earth object and a potentially hazardous one, its discovery and the IAU citation of its name, its close approaches to the Earth and, when Sentry follows it, its impact risk; a search by name or designation (the SBDB Query API).

No key. One call per entity (sbdb.api answers everything at once), one per search page. JPL's fair use policy: one request at a time, an application-specific User-Agent with a contact (set "mailto"); the calls are spaced by 0.2 s by default.

const BASE_URI = 'https://ssd-api.jpl.nasa.gov/'
const MAX_PER_PAGE = 100

The most objects one search page is asked for.

JplSource::__construct()

public function __construct(HttpClientInterface $http, readonly int $synonyms = 20, readonly ?\DateTimeImmutable $now = null, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.2)
$synonyms

how many alternate designations to keep (0: none)

$now

the moment "next close approach" is reckoned from (null: now)

JplSource::getName()

public function getName(): string

JplSource::capabilities()

public function capabilities(): array

JplSource::entity()

public function entity(Identifier|string $id): ?Entity

A small body by what the SBDB reads (sstr): a number, a designation, a name. A string that matches several bodies ("Halley": 1P/Halley and the asteroid 2688 Halley) is null rather than a guess.

public function search(Query $query): Page

Bodies whose name holds the text (whatever its case), or whose designation is the text, through the SBDB Query API, in the database's order (numbered first, by number).

JplSourceFactory class

final class JplSourceFactory extends SourceFactory JplSourceFactory.php:21

JPL's Small-Body Database: asteroids and comets, their orbits, physical parameters, close approaches to the Earth and impact risk - no key needed.

options: mailto: 'support@glitchr.io' # in the User-Agent: JPL's fair use policy asks an application-specific one with a contact synonyms: 20 # how many alternate designations to keep (0: none) throttle: 0.2 # seconds between two calls: JPL asks one request at a time base_uri: 'https://ssd-api.jpl.nasa.gov/'

Options

OptionDefault
synonyms20
nownull
throttle0.2
base_uriJplSource::BASE_URI