Lue dans les fichiers PHP du paquet au commit 4be949028883 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
AlertclassA message of the Space Weather Prediction Center: an alert, a warning, a watch or a summary, as issued.
1 method · 7 properties
SwpcSourceclassNOAA's Space Weather Prediction Center, through its public JSON files (services.swpc.noaa.gov): the probability of seeing an aurora overhead at a point (OVATION's nowcast) as a series - the one thing of space weather that is at a place on the Earth - and, outside the contract (a core Series is at a place), the planetary Kp index observed and predicted, the solar wind at L1 (speed, density, temperature, the magnetic field's strength and Bz), the alerts, warnings and watches, and the NOAA scales of today.
8 methods · 2 constants
SwpcSourceFactoryclassNOAA's Space Weather Prediction Center: the aurora at a point as a series; the Kp index, the solar wind, the alerts and the scales outside the contract - no key.
2 options
TimelineclassA variable of space weather over time - the planetary Kp index, the solar wind's speed at L1 - which the core's Series cannot hold, a Series being at a place on the Earth. Points in time order, a value null where none; $forecastFrom is the first predicted point's time (null when every point is observed or estimated).
7 methods · 6 properties
Omnilab\Swpc
Alert class
final readonly class Alert Alert.php:9
A message of the Space Weather Prediction Center: an alert, a warning, a watch or a summary, as issued.
public string $productthe product id of the list (K04W, XM5S...)
public \DateTimeImmutable $issuedpublic ?string $codethe message's code (WARK04, SUMXM5...)
public ?int $serialpublic ?string $kindALERT, WARNING, WATCH, SUMMARY, EXTENDED WARNING, CANCEL WATCH...
public ?string $titleits first line after the issue time: "WARNING: Geomagnetic K-index of 4 expected"
public string $message
Alert::__construct()
public function __construct(public string $product, public \DateTimeImmutable $issued, public ?string $code, public ?int $serial, public ?string $kind, public ?string $title, public string $message)$productthe product id of the list (K04W, XM5S...)
$codethe message's code (WARK04, SUMXM5...)
$kindALERT, WARNING, WATCH, SUMMARY, EXTENDED WARNING, CANCEL WATCH...
$titleits first line after the issue time: "WARNING: Geomagnetic K-index of 4 expected"
SwpcSource class
final class SwpcSource extends HttpSource SwpcSource.php:27
NOAA's Space Weather Prediction Center, through its public JSON files (services.swpc.noaa.gov): the probability of seeing an aurora overhead at a point (OVATION's nowcast) as a series - the one thing of space weather that is at a place on the Earth - and, outside the contract (a core Series is at a place), the planetary Kp index observed and predicted, the solar wind at L1 (speed, density, temperature, the magnetic field's strength and Bz), the alerts, warnings and watches, and the NOAA scales of today.
No key. Each file is the service's latest: the Kp index of the last seven days and the next three, a day of solar wind, the alerts of about two weeks, the last aurora nowcast.
const BASE_URI = 'https://services.swpc.noaa.gov/'const SOLAR_WIND = ['speed' => ['json/rtsw/rtsw_wind_1m.json', 'proton_speed', 'km/s', 'Solar wind speed'], 'density' => ['json/rtsw/rtsw_wind_1m.json', 'proton_density', 'cm⁻³…The solar wind's variables: the file, its field, the unit, the label.
SwpcSource::__construct()
public function __construct(HttpClientInterface $http, string $baseUri = self::BASE_URI, array $headers = [], float $throttle = 0.0)SwpcSource::getName()
public function getName(): stringSwpcSource::capabilities()
public function capabilities(): arraySwpcSource::series()
public function series(SeriesQuery $query): array"aurora": the probability, in percent, of an aurora seen overhead at the point, from OVATION's latest nowcast (one point, at its forecast time, about half an hour to an hour ahead; the nearest cell of its one-degree grid). Only the latest is published: a period that does not hold its time answers a series without points.
SwpcSource::kp()
public function kp(): TimelineThe planetary Kp index, every three hours, from seven days back to three days ahead: the observed and estimated values, then the predicted ones (from forecastFrom). Outside the contract: the Kp index is the whole Earth's.
SwpcSource::solarWind()
public function solarWind(string ...$variables): arrayThe solar wind at L1, minute by minute over the last day, from the spacecraft SWPC uses at the time (its "active" rows): one Timeline per variable asked (SOLAR_WIND: speed, density, temperature, bt, bz).
Outside the contract: the solar wind is not at a place on the Earth.
SwpcSource::alerts()
public function alerts(): arrayThe alerts, warnings, watches and summaries SWPC issued, the latest first.
SwpcSource::scales()
public function scales(): arrayThe NOAA space weather scales - R (radio blackouts), S (solar radiation storms), G (geomagnetic storms), each 0 to 5 - as SWPC's file gives them, in its order: the day before and the latest observed (their scales), then today and the next two days (the probabilities of R minor and major and of S, in percent, and the G scale predicted). A row: [time, R, S, G, R minor %, R major %, S %].
SwpcSourceFactory class
final class SwpcSourceFactory extends SourceFactory SwpcSourceFactory.php:20
NOAA's Space Weather Prediction Center: the aurora at a point as a series; the Kp index, the solar wind, the alerts and the scales outside the contract - no key.
options: mailto: 'support@glitchr.io' # in the User-Agent throttle: 0 # seconds between two calls: SWPC publishes no figure base_uri: 'https://services.swpc.noaa.gov/'
Options
| Option | Default | |
|---|---|---|
throttle | 0.0 | |
base_uri | SwpcSource::BASE_URI |
Timeline class
final readonly class Timeline implements IteratorAggregate, Countable Timeline.php:14
A variable of space weather over time - the planetary Kp index, the solar wind's speed at L1 - which the core's Series cannot hold, a Series being at a place on the Earth. Points in time order, a value null where none; $forecastFrom is the first predicted point's time (null when every point is observed or estimated).
public string $variablepublic ?string $unitpublic array $pointspublic ?string $labelpublic ?\DateTimeImmutable $forecastFrompublic string $source
Timeline::__construct()
public function __construct(public string $variable, public ?string $unit, public array $points, public ?string $label = null, public ?\DateTimeImmutable $forecastFrom = null, public string $source = 'swpc')Timeline::values()
public function values(): arrayTimeline::times()
public function times(): arrayTimeline::max()
public function max(): int|float|nullTimeline::min()
public function min(): int|float|nullTimeline::getIterator()
public function getIterator(): \ArrayIteratorTimeline::count()
public function count(): int