satpy.resample.bucket module
Bucket resamplers.
- class satpy.resample.bucket.BucketAvg(source_geo_def, target_geo_def)[source]
Bases:
BucketResamplerBaseClass 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:
data (numpy.ndarray | dask.array.Array) – Data to be resampled
fill_value (float | int) – fill_value. Defaults to numpy.nan
skipna (bool) – Skip NA’s. Default True
- Returns:
dask.array.Array
- class satpy.resample.bucket.BucketCount(source_geo_def, target_geo_def)[source]
Bases:
BucketResamplerBaseClass 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.
- class satpy.resample.bucket.BucketFraction(source_geo_def, target_geo_def)[source]
Bases:
BucketResamplerBaseClass for bucket resampling to compute category fractions.
This resampler calculates the fraction of occurences of the input data per category.
Initialize bucket resampler.
- class satpy.resample.bucket.BucketResamplerBase(source_geo_def, target_geo_def)[source]
Bases:
BaseResamplerBase class for bucket resampling which implements averaging.
Initialize bucket resampler.
- 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:
BucketResamplerBaseClass 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.