contrailcirrus / pycontrails

Python library for modeling contrails and other aviation climate impacts
https://py.contrails.org/
Apache License 2.0
59 stars 17 forks source link

Feature/update resample and fill #271

Open roger-teoh opened 1 week ago

roger-teoh commented 1 week ago

Closes #XX

Changes

Improve _altitude_interpolation function in resample_and_fill and ensure it is consistent with the existing GAIA publication (Teoh et al., 2024)

Breaking changes

Features

Fixes

Internals

The function _altitude_interpolation now accounts for various scenarios. For example:

  1. Flight will automatically climb to an assumed cruise altitude if the first and next known waypoints are at very low altitudes with a large time gap,
  2. If there are large time gaps between known waypoints with a small altitude difference, then the flight will climb at the mid-point
  3. If there are large time gaps and positive altitude difference, then the flight will climb at the start of its interpolation until the known cruising altitude and start its cruise phase.
  4. If there are large time gaps and negative altitude difference, then the flight will continue cruising and only starts to descent towards the end of the interpolation.
  5. If there is a shallow climb (ROCD < 500 ft/min), then always assume that the flight will climb at the next time step
  6. If there is a shallow descent (-250 < ROCD < 0 ft/min), then always assume that the flight will descent at the final time step

Conditions (3) to (6) is based on the logic that the aircraft will generally prefer to climb to a higher altitude as early as possible, and descent to a lower altitude as late as possible, because a higher altitude can reduce drag and fuel consumption.

Therefore, the optional input parameter climb_descend_at_end is no longer needed.

Tests

Reviewer

Select @ reviewer