英文:
Converting pixel data from SEVIRI satellite images to lat, lon values using pyproj and cartopy
问题
我正在尝试绘制来自卫星图像的特定数据,例如此图像卫星图像。 数据由图片的像素引用。 每张图片的高度和宽度均为1024px,来自静止卫星(SEVIRI),纬度范围从30°到-30°,经度范围从30°到105°。 数据点包含信息,例如:宽度:800px,高度:305px。 不幸的是,我对所有这些投影方法感到困惑。 如何将像素值转换为纬度、经度值?
英文:
I am trying to plot specific Data from satellite Images like this one satellite image. The Data is referenced by Pixels of the Picture. Every Picture has 1024px in height and width and is from a geostationary satellite (SEVIRI) with the boundaries of latitude of 30° to -30° and longitude from 30° to 105°. A datapoint has the information for example: width:800px height: 305px. Unfortunately i am lost with all these projection methods. How can i transform the pixel values in lat, lon values?
答案1
得分: 0
以下是您要翻译的内容:
原始数据,由SEVIRI记录,按定义处于静止卫星投影中。但如果它已经以某种方式重采样为经纬度,您可以直接使用已经存在的范围。如果它在另一个投影中,您需要知道它是什么,这不是任何人都能知道的事情。
尽管如此,这个假设似乎相当合理。您可以使用Matplotlib读取它,分配您提到的范围,这与叠加的海岸线非常匹配:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fn = "ieZPH.jpg"
data = plt.imread(fn)
extent = (30, 105, 30, -30)
proj = ccrs.PlateCarree()
fig, ax = plt.subplots(figsize=(10,7), dpi=96, facecolor="w", subplot_kw=dict(projection=proj))
ax.imshow(data, extent=extent, transform=ccrs.PlateCarree(), origin="lower")
ax.coastlines(color="r", linestyle="--")
ax.set_extent(extent, crs=proj)
ax.gridlines(draw_labels=True)
英文:
The original data, as recorded by SEVIRI, by definition is in the geostationary projection. But if this is somehow already resampled to lat/lon you can just use the extent as you already have it. If it's in another projection, you would need to know what it is, it's not something anyone but you can know.
That said, the assumption seems to hold quite well. You can read it with Matplotlib, assign the extent you mentioned, which matches the overlaid coastlines quite well:
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
fn = "ieZPH.jpg"
data = plt.imread(fn)
extent = (30, 105, 30, -30)
proj = ccrs.PlateCarree()
fig, ax = plt.subplots(figsize=(10,7), dpi=96, facecolor="w", subplot_kw=dict(projection=proj))
ax.imshow(data, extent=extent, transform=ccrs.PlateCarree(), origin="lower")
ax.coastlines(color="r", linestyle="--")
ax.set_extent(extent, crs=proj)
ax.gridlines(draw_labels=True)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论