1

我正在按照Pyresample 示例绘制 Sentinel-3 场景和海岸线。但是,似乎pyresample.kd_tree.resample_nearestpyresample.save_quicklook期望将 2D 数组作为数据,而不是我试图绘制的 3D(3 波段)Sentinel 场景:

<xarray.DataArray 'reshape-fb54fb4cbc6c65d43122d7b5e1078a83' (bands: 3, y: 352, x: 507)>
dask.array<reshape, shape=(3, 352, 507), dtype=float64, chunksize=(3, 352, 507), chunktype=numpy.ndarray>
Coordinates:
  * x        (x) float64 -7.601e+04 -7.571e+04 ... 7.571e+04 7.601e+04
  * y        (y) float64 5.227e+04 5.197e+04 5.167e+04 ... -5.279e+04 -5.309e+04
  * bands    (bands) <U1 'R' 'G' 'B'
    crs      object PROJCRS["unknown",BASEGEOGCRS["unknown",DATUM["World Geod...
Attributes: (12/15)
    resolution:              300
    ancillary_variables:     []
    start_time:              2020-04-22 13:51:38
    area:                    Area ID: area_id\nDescription: An Area of Interest\n...
    end_time:                2020-04-22 13:54:38
    sensor:                  olci
    ...                      ...
    name:                    ocean_color
    _satpy_id:               DataID(name='ocean_color', resolution=300)
    standard_name:           ocean_color
    prerequisites:           [DataQuery(name='Oa08', modifiers=('effective_so...
    optional_prerequisites:  []
    mode:                    RGB

伪代码和错误是:

lons, lats = scn_aoi[composite].area.get_lonlats()
composite_data = scn_aoi[composite].data.compute()
swath_def = pyresample.SwathDefinition(lons, lats)
roi = resolution - (resolution * 0.35)
# Below gives ValueError -> 'Mismatch between geometry and dataset'
composite_swath = (pyresample.kd_tree
                   .resample_nearest(swath_def, composite_data, aoi_def,
                                     radius_of_influence=roi,
                                     fill_value=None))

如何绘制这些数据?

4

0 回答 0