0

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 Answers1

0

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)

enter image description here

Rutger Kassies
  • 61,630
  • 17
  • 112
  • 97
  • Then what's the issue if you already know this? Can't you just convert it with the information you have? The conversion of the satellite data to a pixel is basically the inverse. Like `lon = 30° + (105° - 30°) / 1024px * 800px`, or define an affine transform if you have to do it a lot. – Rutger Kassies May 22 '23 at 16:43
  • 1
    i realized that your comments key Information was that the projection is already done with the satellite image. Therefore i deleted my previous comment. Thank you so much for helping me out. – Stehpflanze May 22 '23 at 18:02