{"library":"pyresample","title":"pyresample","description":"Pyresample is a Python library for geospatial image resampling, supporting both area-to-area and swath-to-area resampling. It is part of the PyTroll ecosystem. Current version is 1.35.0, with regular releases approximately every 2-3 months.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pyresample"],"cli":null},"imports":["from pyresample import AreaDefinition","from pyresample import SwathDefinition","from pyresample.kd_tree import resample_nearest","from pyresample.area_config import load_area"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import numpy as np\nfrom pyresample import AreaDefinition, SwathDefinition\nfrom pyresample.kd_tree import resample_nearest\n\n# Define source swath (e.g., satellite granule)\nlon = np.array([[-10, -9], [-10, -9]])\nlat = np.array([[40, 40], [41, 41]])\nswath_def = SwathDefinition(lons=lon, lats=lat)\n\n# Define target area (regular grid)\narea_def = AreaDefinition(\n    area_id='test',\n    description='Test area',\n    proj_id='test',\n    projection='+proj=eqc +lon_0=0 +lat_0=0',\n    width=100,\n    height=100,\n    area_extent=[-20, 30, 10, 50]\n)\n\n# Source data (same shape as swath)\ndata = np.random.rand(2, 2)\n\n# Resample using nearest neighbor\nresult = resample_nearest(swath_def, data, area_def, radius_of_influence=50000)\nprint(result.shape)  # (100, 100)","lang":"python","description":"Basic swath-to-area resampling with nearest neighbor method.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}