Feature Composite (rojak.atmosphere.feature_composite)#
Composites of observations about atmospheric features, such as lows, in each feature’s own km frame.
Observations, e.g. AMDAR turbulence reports, are composited about every centre of a feature, then compared with controls to show how the feature changes the traffic and the probability of events.
The counterfactual is what would have been observed if the feature weren’t there. It can’t be observed directly.
A control is the observations or the field resampled with the feature removed, used to estimate the counterfactual.
The parts of a composite:
Features find the centres to composite about in time-chunked fields.
ExtremaPointFeaturefinds lows or highs, one centre per extremum.Pairing matches observations with the centres at the same time step:
LabelledRegionPairingby the region each centre owns,DistancePairingby distance.Bins count the pairs in each centre’s km frame:
BinSpec.grid()for a 2D(y_km, x_km)grid.Controls pair the same centres with observations from another time:
ControlDesign.Statistics come from the counts after they are computed:
impact_statistics()for the traffic ratio, the relative risk and the odds ratio, andbootstrap()for intervals of any of them.
composite_observations_about_features() builds the dask graph and returns lazy counts per time chunk. With
return_pairs=True, it also returns the centre and pair tables, whose columns are named by Column:
counts = composite_observations_about_features(
ExtremaPointFeature(mslp, ExtremaKind.MINIMA, threshold=100_000),
observations,
pairing=LabelledRegionPairing(),
bins=BinSpec.grid(2000, 50),
controls=[ControlDesign("obs-7D", observation_offset=np.timedelta64(-7, "D"))],
).compute()
impact = impact_statistics(counts, min_count=20)
intervals = bootstrap(counts, impact_statistics, n_samples=500)
To add a new kind of feature or pairing, see rojak.atmosphere.feature_composite.extension.
Functions
|
Quantiles of any statistic of the counts, from a block bootstrap over the chunks. |
Lazily count the observations about each centre of a feature, and about its controls, per time chunk. |
|
|
How the feature changes traffic and the probability of each event, relative to the controls. |
Classes
|
The bins that pairs are counted on, in the km frame of their centre. |
|
Names of the columns that the feature composite reads from and writes to its per-chunk tables. |
|
How to build one control: a resampling with the feature removed, used to estimate the counterfactual. |
|
Pair each observation with every centre at the same time step within |
|
Lows or highs: one point feature per extremum of a field, found by |
Pair each observation with the centre that owns the grid cell nearest to it, if any. |