Weather

Weather loads ERA5-style NetCDF files and provides wind-aware ground speeds along a mission’s ground track.

The dataset is read from disk (no pre-processing required) and must contain:

  • variables: temperature t [K], eastward wind u [m/s], northward wind v [m/s]

  • coordinates: pressure_level [hPa], latitude, longitude

  • optional dimension: valid_time (sliced using mission.departure.hour if present)

During a ground-speed query, altitude is converted to a pressure level using a standard-atmosphere approximation, winds are interpolated at the requested longitude/latitude, and those winds are combined with the aircraft heading derived from the ground track (or an override supplied via azimuth).

Example:

mission = Mission(...)
track = GroundTrack.great_circle(
    mission.origin_position.location,
    mission.destination_position.location,
)

weather = Weather('data/weather/sample_weather_subset.nc', mission, track)
ground_speed = weather.get_ground_speed(
    ground_distance=5000.0,  # meters from departure
    altitude=10000.0,        # meters
    true_airspeed=230.0,      # m/s
)

Class members

class AEIC.weather.weather.Weather(data_dir: str | Path)

A class to query weather data variables and ground speed along ground track points.

Parameters:

data_dir (str | Path) – Path to directory containing ERA5 weather data NetCDF files. The files should have names of the form ‘YYYYMMDD.nc’, one per day. File should contain variables: ‘t’, ‘u’, ‘v’ with coordinates ‘pressure_level’, ‘latitude’, ‘longitude’, ‘valid_time’ (optional)

get_ground_speed(time: Timestamp, gt_point: Point, altitude: float, true_airspeed: float, azimuth: float | None = None) float

Compute ground speed at a point along the mission.

Parameters:
  • time (pd.Timestamp) – Time at the ground track point [UTC].

  • gt_point (GroundTrack.Point) – Spatial point along the ground track from the origin.

  • altitude (float) – Altitude above sea level [meters].

  • true_airspeed (float) – True airspeed [m/s].

  • azmiuth (float, optional) – Azimuth [degrees]. If omitted, use the precomputed ground-track azmith.

Returns:

ground_speed – Ground speed [m/s]

Return type:

float