Closed sfinkens closed 7 years ago
Stephan,
I think you understood right, but the area definition in pyresample refers to the outer boundary of the area. So you have to subtract/add half a pixel on the corners.
Your mycorners are:
[-5568753.6104812799, -5565753.2044411488, 5565753.2044411488, 5568753.6104812799]
But they should rather be:
[-5570253.813501345, -5567253.4074612139, 5567253.4074612139, 5570253.813501345]
So your code should looks something like this:
xscale = (x_proj[-1] - x_proj[0]) / (x_proj.shape[0] - 1)
yscale = (y_proj[-1] - y_proj[0]) / (y_proj.shape[0] - 1)
mycorners = [x_proj[0] - xscale / 2., -y_proj[-1] - yscale /
2., x_proj[-1] + xscale / 2., -y_proj[0] + yscale / 2.]
-Adam
With the above adjustment you get an area extent that differs by an offset of 5.3 meters to the one we have as default in areas.def
. Here is the default definition used in pytroll:
REGION: met09globeFull {
NAME: Full globe MSG image 0 degrees
PCS_ID: geos0
PCS_DEF: proj=geos, lon_0=0.0, a=6378169.00, b=6356583.80, h=35785831.0
XSIZE: 3712
YSIZE: 3712
AREA_EXTENT: (-5570248.4773392612, -5567248.074173444, 5567248.074173444, 5570248.4773392612)
};
I see that a,b,h all differ slightly from yours. Not sure why!
Brilliant! Thanks for the clarification, Adam. I just copied the constants from the CGMS document for this example. In practice we use the same constants as NWCSAF-MSG does. They are slightly different from CGMS, but identical to the pytroll definition.
I tried to reproduce the geographical coordinates of an MSG/SEVIRI image using
pyresample.geometry.AreaDefinition.get_lonlats()
but found small differences from the results obtained by the CGMS formulas for the geostationary projection. Here is an example snippet:Did I understand/implement the CGMS formulas incorrectly or is that a pyresample issue? I'm using pyresample-1.5.0 .