Weather
weather
Validated weather grids and optional contrail-engine exports.
These containers do not download, extrapolate, derive cirrus optical depth or convert accumulated radiation. Coordinates are effective interpolation times in UTC nanoseconds; callers resolve source-specific time conventions first.
RadiationCube
dataclass
TOA flux grid with explicitly resolved timestamps.
Arrays have dimensions (lon, lat, time). time_semantics must be
valid (instantaneous flux) or interval_midpoint (mean flux assigned
to its averaging-interval midpoint). Interval-end or accumulated radiation
must be converted upstream. No engine export shifts these timestamps.
Source code in packages/barograph-met/src/baro/met/weather.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | |
coordinates
property
Coordinates in native engine dimension order.
coverage
property
Inclusive coordinate bounds, without implying extrapolation support.
shape
property
Required array shape in export axis order.
specs
property
Recognized variables, canonical and engine units.
__post_init__()
Validate axes, shape, units, and timestamp semantics.
Source code in packages/barograph-met/src/baro/met/weather.py
to_diffcocip()
Export the NumPy dict accepted by diffcocip, without importing JAX.
Every interpolation axis needs at least two points. The engine's time bridge uses seconds since 2000; grids before this epoch are rejected. Metadata stays available on this container, not in the engine dict.
Source code in packages/barograph-met/src/baro/met/weather.py
to_pycontrails(*, require_cocip=True)
Export an optional pycontrails MetDataset with resolved time metadata.
Import pycontrails and xarray only on this call. Radiation's time
coordinate is marked as resolved, preventing a second engine shift.
Set require_cocip=False to export partial fields for preprocessing.
Source code in packages/barograph-met/src/baro/met/weather.py
WeatherCube
dataclass
Bases: RadiationCube
Pressure-level grid with dimensions (lon, lat, level_hpa, time).
A cube may contain wind only; CoCiP exports require u, v, t, q, omega,
tau_cirrus. Optical depth must be supplied after a correct full-column
calculation; it cannot safely be derived from a cropped pressure slab.
Source code in packages/barograph-met/src/baro/met/weather.py
coordinates
property
Engine coordinates, including pressure in hPa.
shape
property
Required array shape in export axis order.
specs
property
Pressure-level fields and units.
__post_init__()
Validate the pressure axis and inherited grid contract.