pytroll / pytroll/pyresample

Documentation - ImageContainer is deprecated and should not appear as the default in RTD pages

Open
#632 1 comment 0 reactions 1 assignee View on GitHub

@adybbroe is already working on this.

Since Nov 18, 2024.

bug documentation
Dominant language
Python
Stars
385
Forks
102
Avg merge
4d 2h
Merged PRs (30d)
9

Description

Code Sample, a minimal, complete, and verifiable piece of code

The following code snippet is taken directly from the RTD pages:

import numpy as np
from pyresample import image, geometry

area_def = geometry.AreaDefinition('areaD', 'Europe (3km, HRV, VTC)', 'areaD',
                                   {'a': '6378144.0', 'b': '6356759.0',
                                    'lat_0': '50.00', 'lat_ts': '50.00',
                                    'lon_0': '8.00', 'proj': 'stere'},
                                   800, 800,
                                   [-1370912.72, -909968.64,
                                    1029087.28, 1490031.36])

data = np.fromfunction(lambda y, x: y*x, (50, 10))
lons = np.fromfunction(lambda y, x: 3 + x, (50, 10))
lats = np.fromfunction(lambda y, x: 75 - y, (50, 10))
swath_def = geometry.SwathDefinition(lons=lons, lats=lats)
swath_con = image.ImageContainerNearest(data, swath_def, radius_of_influence=5000)
area_con = swath_con.resample(area_def)
result = area_con.image_data
Problem description

The above code produce a deprecation warning!

.../pyresample/image.py:252: FutureWarning: Usage of ImageContainer is deprecated, please use NumpyResamplerBilinear class instead

In https://pyresample.readthedocs.io/en/latest/howtos/swath.html the first example of resampling "swath" data mention a deprecated class:

The ImageContainerNearest and ImageContanerBilinear classes can be used for resampling of swaths as well as grids. Below is an example using nearest neighbour resampling.

Expected Output
Actual Result, Traceback if applicable
Versions of Python, package at hand and relevant dependencies

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.