微软行星云计算Planetary Computer——Sentinel-2 Level-2A数据去云

本教程根据卫星图像的时间序列构建无云影像图。我们将看到以下内容:

  • 查找地球上特定点的时间序列图像

  • 将这些图像堆叠成一个数组

  • 通过取中值计算无云马赛克

  • 可视化结果

此示例使用Sentinel-2 Level-2A数据。这里使用的技术同样适用于其他遥感数据集。

先看以下数据介绍:

 我们可以通过在线的影像查看sentinel数据的云量状态:

Planetary Computer

<
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
以下是使用ERA5数据生成行星边界层高度图的 Python 代码: ```python import numpy as np import xarray as xr import matplotlib.pyplot as plt # Load ERA5 data using xarray data = xr.open_dataset('/path/to/era5/data.nc') # Extract variables u = data.u10 # 10m zonal wind component v = data.v10 # 10m meridional wind component t = data.t2m # 2m temperature sp = data.sp # Surface pressure z = data.z # Geopotential # Calculate potential temperature theta = t * (1000 / sp) ** 0.286 # Calculate geostrophic wind f = 2 * 7.2921e-5 * np.sin(np.deg2rad(data.latitude)) ug = -1 / f * v.differentiate('longitude') # zonal geostrophic wind vg = 1 / f * u.differentiate('longitude') # meridional geostrophic wind # Calculate ageostrophic wind ua = u - ug # zonal ageostrophic wind va = v - vg # meridional ageostrophic wind # Calculate absolute vorticity avort = (vg.differentiate('longitude') - ug.differentiate('latitude')) + f # Calculate vertical vorticity vort = avort - f # Calculate boundary layer height using Ekman layer theory Cd = 1e-3 # Drag coefficient rho = 1.225 # Air density h = (Cd * rho * 2 * np.pi / (24 * 3600)) ** (1 / 3) * (ug ** 2 + vg ** 2) ** (1 / 6) # Convert geopotential height to meters z_m = z / 9.81 # Calculate planetary boundary layer height pblh = xr.DataArray(np.zeros_like(t), dims=t.dims, coords=t.coords) lev = z_m.level.values for i in range(len(t.latitude)): for j in range(len(t.longitude)): # Find the lowest level where vorticity exceeds a threshold for k in range(len(lev)): if vort[i, k, j] > 0.05: pblh[i, j] = lev[k] break # Plot PBL height as a contour map lon, lat = np.meshgrid(pblh.longitude.values, pblh.latitude.values) plt.contourf(lon, lat, pblh.T, cmap='jet') plt.colorbar(label='PBL height (m)') plt.title('Planetary Boundary Layer Height') plt.xlabel('Longitude') plt.ylabel('Latitude') plt.show() ``` 注意,此代码仅提供一个示例,具体实现可能需要根据你的数据格式和需求做出一些修改。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

此星光明

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值