v0.43.0
Support experimental interpolation against gridded specific humidity. Add new data-driven humidity scaling models.
Features
-
Add new experimental
interpolation_q_method
field to theModelParams
data class. This parameter controls the interpolation methodology when interpolation against gridded specific humidity. The possible values are:None
: Interpolate linearly against specific humidity. This is the default behavior and is the same as the previous behavior."cubic-spline"
: Apply cubic-spline scaling to the interpolation table vertical coordinate before interpolating linearly against specific humidity."log-q-log-p"
: Interpolate in the log-log domain against specific humidity and pressure.
This interpolation parameter is used when calling
pycontrails.core.models.interpolate_met
. It can also be used directly with the new lower-levelpycontrails.core.models.interpolate_gridded_specific_humidity
function. -
Add new experimental
HistogramMatching
humidity scaling model to match RHi values against IAGOS observations. The previousHistogramMatchingWithEckel
scaling is still available when working with ERA5 ensemble members. -
Add new tutorial discussing the new specific humidity interpolation methodology.
Breaking changes
- Add an optional
q_method
parameter to thepycontrails.core.models.interpolate_met
function. The default valueNone
agrees with the previous behavior. - Change function signatures in the
cocip.py
module for consistency. Theinterp_kwargs
parameter is now unpacked in thecalc_timestep_meterology
signature. Renamekwargs
tointerp_kwargs
where appropriate. - Remove the
cache_size
parameter inMetDataset.from_zarr
. Previously this parameter allowed the user to wrap the Zarr store in aLRUCacheStore
to improve performance. Changes to Zarr internals have broken this approach. Custom Zarr patterns should now be handled outside ofpycontrails
.
Fixes
- Recompute and extend quantiles for histogram matching humidity scaling. Quantiles are now available for each combination of
q_method
and the following ERA5 data products: reanalysis and ensemble members 0-9. This data is available as a parquet file and is packaged withpycontrails
. - Fix the precomputed Eckel coefficients. Previous values where computed for different interpolation assumptions and were not correct for the default interpolation method.
- Clip the scaled humidity values computed by the
humidity_scaling.eckel_scaling
function to ensure that they are non-negative. Previously, both relative and specific humidity values arising from Eckel scaling could be negative. - Handle edge case of all NaN values in the
T_critical_sac
function in thesac.py
module. - Avoid extraneous copy when calling
VectorDataset.sum
. - Officially support
numpy
v1.25.0. - Set a
pytest-timeout
limit for tests intests/unit/test_ecmwf.py
to avoid hanging tests. - Add
forecast_step
parameter to theACCF
model.
Internals
- Refactor auxillary functions used by
HistogramMatchingWithEckel
to better isolated histogram matching from Eckel scaling. - Refactor
intersect_met
method inpycontrails.core.models
to handle experimentalq_method
parameter. - Include a
q_method
field inModel.interp_kwargs
. - Include precomputed humidity lapse rate values in the new
pycontrails.core.models._load_spline
function. - Move the
humidity_scaling.py
module into its own subdirectory withinpycontrails/models
.