satpy.resample.bucket module

Bucket resamplers.

class satpy.resample.bucket.BucketAvg(source_geo_def, target_geo_def)[source]

Bases: BucketResamplerBase

Class for averaging bucket resampling.

Bucket resampling calculates the average of all the values that are closest to each bin and inside the target area.

Parameters:
  • fill_value ((float) default: np.nan) – Fill value to mark missing/invalid values in the input data, as well as in the binned and averaged output data.

  • skipna ((bool) default: True) – If True, skips missing values (as marked by NaN or fill_value) for the average calculation (similarly to Numpy’s nanmean). Buckets containing only missing values are set to fill_value. If False, sets the bucket to fill_value if one or more missing values are present in the bucket (similarly to Numpy’s mean). In both cases, empty buckets are set to fill_value.

Initialize bucket resampler.

compute(data, fill_value=nan, skipna=True, **kwargs)[source]

Call the resampling.

Parameters:
Returns:

dask.array.Array

class satpy.resample.bucket.BucketCount(source_geo_def, target_geo_def)[source]

Bases: BucketResamplerBase

Class for bucket resampling which implements hit-counting.

This resampler calculates the number of occurences of the input data closest to each bin and inside the target area.

Initialize bucket resampler.

compute(data, **kwargs)[source]

Call the resampling.

class satpy.resample.bucket.BucketFraction(source_geo_def, target_geo_def)[source]

Bases: BucketResamplerBase

Class for bucket resampling to compute category fractions.

This resampler calculates the fraction of occurences of the input data per category.

Initialize bucket resampler.

compute(data, fill_value=nan, categories=None, **kwargs)[source]

Call the resampling.

class satpy.resample.bucket.BucketResamplerBase(source_geo_def, target_geo_def)[source]

Bases: BaseResampler

Base class for bucket resampling which implements averaging.

Initialize bucket resampler.

__init__(source_geo_def, target_geo_def)[source]

Initialize bucket resampler.

_adjust_attrs(attrs)[source]
compute(data, **kwargs)[source]

Call the resampling.

precompute(**kwargs)[source]

Create X and Y indices and store them for later use.

resample(data, **kwargs)[source]

Resample data by calling precompute and compute methods.

Parameters:

data (xarray.DataArray) – Data to be resampled

Returns (xarray.DataArray): Data resampled to the target area

class satpy.resample.bucket.BucketSum(source_geo_def, target_geo_def)[source]

Bases: BucketResamplerBase

Class for bucket resampling which implements accumulation (sum).

This resampler calculates the cumulative sum of all the values that are closest to each bin and inside the target area.

Parameters:
  • fill_value ((float) default: np.nan) – Fill value for missing data

  • skipna ((bool) default: True) – If True, skips NaN values for the sum calculation (similarly to Numpy’s nansum). Buckets containing only NaN are set to zero. If False, sets the bucket to NaN if one or more NaN values are present in the bucket (similarly to Numpy’s sum). In both cases, empty buckets are set to 0.

Initialize bucket resampler.

compute(data, skipna=True, **kwargs)[source]

Call the resampling.

satpy.resample.bucket._check_coords_results_dims(result, data, dims)[source]
satpy.resample.bucket._get_dims(data)[source]
satpy.resample.bucket.get_resampler_classes()[source]

Get bucket resampler classes.