Issue with MSG hsaf projection

44 views
Skip to first unread message

Fabio Mingione

unread,
Apr 21, 2022, 5:43:35 AM4/21/22
to pytroll
Hi,

We're experiencing an issue with the satpy processing of the MSG hsaf projection. As you can see from the attached image, satpy_msg.png, it appears that the projection is not recognized correctly and, as a consequence, the resulting image is deformed. 

The processing of the same files with the mpop package gave us the desired results instead.

Do you have any suggestions on how to solve the problem with satpy?

-----------------------------------------------------------------------------------------------
Satpy, areas.yaml extract:

hsaf:
description: HSAF
projection:
proj: geos
lon_0: 0.0
a: 6378169.00
b: 6356583.80
h: 35785831.0
shape:
height: 900
width: 1900
area_extent:
lower_left_xy: [-2276350.0000, 2621577.18962]
upper_right_xy: [3410000.05995, 5320248.4773392612]

------------------------------------------------------------------------------------------------
mpop, areas.def extract:

REGION: hsaf{
NAME: hsaf
PCS_ID: hsaf
PCS_DEF: proj=geos, lon_0=0.0, a=6378169.00, b=6356583.80, h=35785831.0
XSIZE: 1900
YSIZE: 900
AREA_EXTENT: (-2276350.0000, 2621577.18962, 3410000.05995, 5320248.4773392612)

-----------------------------------------------------------------------------------

Thank you in advance.

Kind regards,
Fabio Mingione

mpop_msg.png
satpy_msg.png

Raspaud Martin

unread,
Apr 21, 2022, 5:48:47 AM4/21/22
to pyt...@googlegroups.com
Hi Fabio,

Thanks for reaching out to us!
This is very strange indeed. Before I start to speculate on a possible
cause, could you attach the script that produces this images in satpy?

Best regards,
Martin

Fabio Mingione

unread,
Apr 21, 2022, 5:59:12 AM4/21/22
to pytroll
Thank you for your quick reply Martin,

Of course, please find attached the .py script we use to produce these images.

sfloc_hsaf.py

Fabio Mingione

unread,
Apr 21, 2022, 6:05:44 AM4/21/22
to pytroll

Here is our self-defined composite in

composites/seviri.yaml :

palette_ir_clouds2:

compositor: !!python/name:satpy.composites.SingleBandCompositor
prerequisites:
- name: 'IR_108'
standard_name: palette_ir_clouds2


and in  enhancements/generic.yaml  :

palette_ir_clouds2:
standard_name: palette_ir_clouds2
operations:
- name: colorize
method: !!python/name:satpy.enhancements.colorize
kwargs:
palettes:
- {colors: greys, min_value: 215.27, max_value: 312.91}

José Daniel Gómez de Segura

unread,
Apr 21, 2022, 6:09:47 AM4/21/22
to pyt...@googlegroups.com
Hi,

I'd like to mention that we have also experienced problems with HSAF projections, but not so wild:

Cheers,

José

--
You received this message because you are subscribed to the Google Groups "pytroll" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/28c3b3b2-f9c4-48bb-85e1-e1f1f1c2539cn%40googlegroups.com.

Raspaud Martin

unread,
Apr 26, 2022, 6:42:09 AM4/26/22
to pyt...@googlegroups.com
Thanks Fabio for all the data. Sorry I couldn't answer earlier.

I could reproduce the problem, and a first idea I have is I there might
be a bug in satpy or pyresample regarding how space data is
masked/resampled.

Could you create an issue on github for this (on the satpy repository)?
That way I can easily put it at the list of things we need to look at
during the Pytroll Contributors Week next week.

Thanks again.
Best regards,
Martin

Raspaud Martin

unread,
Apr 26, 2022, 6:56:28 AM4/26/22
to pyt...@googlegroups.com
Fabio,

Another thing I noticed: the HSAF area that you resample to has
actually the same projection as the original HRIT data that you are
reading. As such, could it be that you don't need resampling, but
actually just need to crop the data to fit your area?

For that, we have the `crop` method of the scene object that you can
have a look at:
https://satpy.readthedocs.io/en/stable/api/satpy.scene.html#satpy.scene.Scene.crop

Using the area boundaries that you gave in your first email, I could
generate an image that seems to mach your area like this:

scn.load(["IR_108"], generate=False, upper_right_corner='NE')
newscn = scn.crop(xy_bbox=(-2276350.0000, 2621577.18962, 3410000.05995,
5320248.4773392612))
newscn.save_datasets(base_dir='/tmp', tiled=True, blockxsize=512,
blockysize=512, driver='COG', overviews=[])

Best regards,
Martin

On Thu, 2022-04-21 at 03:05 -0700, Fabio Mingione wrote:

Fabio Mingione

unread,
Apr 28, 2022, 10:17:20 AM4/28/22
to pytroll
Thank you very much Martin!

The code in your last reply worked perfectly for us as well.

Reply all
Reply to author
Forward
0 new messages