Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
adybbroe opened this issue Nov 18, 2024 · 1 comment
Assignees

Comments

@adybbroe
Copy link
Contributor

adybbroe commented Nov 18, 2024

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

@djhoese
Copy link
Member

djhoese commented Nov 18, 2024

Yeah I'd love to get the resampler classes/objects finalized and suggest their usage in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants