Skip to content

Commit

Permalink
Merge pull request #987 from pytroll/add-swath-to-aggregrate
Browse files Browse the repository at this point in the history
scene.aggregate will now handle a SwathDefinition
  • Loading branch information
mraspaud committed Dec 26, 2019
2 parents 5ce2122 + 4e9f0aa commit e2100df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion satpy/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,10 @@ def aggregate(self, dataset_ids=None, boundary='exact', side='left', func='mean'
if boundary != 'exact':
raise NotImplementedError("boundary modes appart from 'exact' are not implemented yet.")
target_area = src_area.aggregate(**dim_kwargs)
resolution = max(target_area.pixel_size_x, target_area.pixel_size_y)
try:
resolution = max(target_area.pixel_size_x, target_area.pixel_size_y)
except AttributeError:
resolution = max(target_area.lats.resolution, target_area.lons.resolution)
for ds_id in ds_ids:
res = self[ds_id].coarsen(boundary=boundary, side=side, func=func, **dim_kwargs)

Expand Down

0 comments on commit e2100df

Please sign in to comment.