geoarray.coords¶
What a carrier's dims mean. The 1-D axes live in a carrier's coords and
slice with their dim; the grid coordinates describe the spatial dims.
1-D axes¶
geoarray.coords.SpectralAxis
dataclass
¶
Spectral channels on the band dim: names, wavelengths, FWHM.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
tuple[str, ...]
|
One name per band ( |
required |
wavelength_nm
|
tuple[float, ...] | None
|
Centre wavelength of each band, in nm. |
None
|
fwhm_nm
|
tuple[float, ...] | None
|
Full width at half maximum of each band, in nm. |
None
|
Raises:
| Type | Description |
|---|---|
ValueError
|
Names repeat, or a wavelength / FWHM list has another length. |
Example
swir = SpectralAxis(names=("B11", "B12"), wavelength_nm=(1610.0, 2190.0)) swir.dim, swir.size, swir.isel([1]).names ('band', 2, ('B12',))
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.VariableAxis
dataclass
¶
Physical quantities on the variable dim: names and units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
tuple[str, ...]
|
One name per variable ( |
required |
units
|
tuple[str, ...] | None
|
The unit of each variable ( |
None
|
Example
met = VariableAxis(names=("t2m", "psfc"), units=("K", "hPa")) met.isel(slice(1, None)).units ('hPa',)
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.VerticalAxis
dataclass
¶
Shared vertical levels on the level dim.
A level dim is for samples on one vertical grid (TROPOMI's retrieval
layers, EN4 depths); a point with its own vertical position has a z
leaf on GeoPoints instead.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
tuple[float, ...]
|
One value per level, in |
required |
vertical
|
Vertical
|
What the values measure. |
required |
Example
depth = Vertical(kind="depth", units="m", positive="down") VerticalAxis(values=(5.0, 15.0, 25.0), vertical=depth).isel([0, 2]).values (5.0, 25.0)
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.Vertical
dataclass
¶
What a vertical coordinate measures, in CF terms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
required |
units
|
str
|
|
required |
positive
|
str
|
CF |
required |
datum
|
str | None
|
The reference surface ( |
None
|
Example
Vertical(kind="depth", units="m", positive="down").positive 'down'
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.TimeAxis
dataclass
¶
Shared acquisition times on the time dim.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stamps
|
Any
|
One time per entry: |
required |
Hashes and compares by value. A moving platform (along-track altimetry,
Argo) has one time per point instead: a time leaf on GeoPoints.
On a carrier the stamps are a pytree leaf, as int64 nanoseconds
since the epoch: a new set of dates of the same length reuses the
compiled program. On the host they are datetime64[ns] labels; on a
JAX carrier (GeoArray.to_jax) a JAX int64 array; inside jit
a tracer, whose labels are None (select times outside jit).
Example
dates = TimeAxis(stamps=["2026-06-01", "2026-06-11"]) dates.size, str(dates.labels[1]) (2, '2026-06-11T00:00:00.000000000')
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 | |
labels
property
¶
The stamps as numpy.datetime64[ns]; None when traced.
size
property
¶
The number of times.
as_leaf()
¶
The stamps as int64 nanoseconds since the epoch, for a pytree leaf.
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
from_leaf(stamps)
classmethod
¶
A TimeAxis around int64 nanoseconds (NumPy, JAX or a tracer).
No validation or copy: for pytree unflattening and backend moves.
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
isel(index)
¶
The times at index (on the stamps' own backend).
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
to_host()
¶
This axis with datetime64[ns] NumPy stamps.
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.Coordinate
¶
Bases: Protocol
What a 1-D coordinate of a carrier dim provides.
dim names the dim it describes, size its length; labels are
the exact labels sel looks up (or None); isel slices it with
its dim (a slice, or a list / 1-D array of positions; an integer drops
the dim, so the carrier drops the coordinate instead).
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
Grids¶
geoarray.coords.PixelGrid
dataclass
¶
An affine pixel grid on the y x dims: shape, CRS, pixel convention.
The transform itself is a leaf on the carrier, so a new scene of the same shape and CRS reuses the compiled program.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple[int, int]
|
|
required |
crs
|
CRS | None
|
Anything |
required |
convention
|
str
|
|
'area'
|
Example
grid = PixelGrid(shape=(600, 600), crs="EPSG:32613") grid.dims, grid.crs.to_epsg() (('y', 'x'), 32613)
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
area_transform(transform)
¶
transform in the area convention carriers store.
A point-convention transform maps pixel (j, i) to its centre, so the edge transform is T shifted by half a pixel: c′ = c − (a + b)/2, f′ = f − (d + e)/2. An area transform is returned as it is.
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
centres(transform)
¶
Map coordinates (x, y) of every pixel centre, each (H, W).
x_ij = a·(j + ½) + b·(i + ½) + c, y_ij = d·(j + ½) + e·(i + ½) + f for an area transform; without the ½ for a point transform.
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.SwathGrid
dataclass
¶
A swath in sensor geometry on the row col dims: shape and CRS.
Rows run along track, columns across; per-pixel lat/lon are leaves on the carrier.
Example
SwathGrid(shape=(1280, 1242), crs="EPSG:4326").dims ('row', 'col')
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
geoarray.coords.CurvilinearGrid
dataclass
¶
A model grid with fixed 2-D lat/lon (ORCA) on the row col dims.
Unlike a swath, the lat/lon never change between calls, so they are static; hashes and compares by value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lat
|
Any
|
|
required |
lon
|
Any
|
|
required |
crs
|
CRS | None
|
The CRS of lat/lon ( |
required |
Example
import numpy as np lat, lon = np.meshgrid(np.arange(3.0), np.arange(4.0), indexing="ij") CurvilinearGrid(lat, lon, "EPSG:4326").shape (3, 4)
Source code in packages/geotoolz-array/src/geoarray/_src/coords.py
shape
property
¶
(row, col).
geoarray.coords.PointAxis
dataclass
¶
Scattered samples on the obs dim: N and the CRS of their xy.
Example
PointAxis(size=40, crs="EPSG:4326").dims ('obs',)