Himawari HSD segment data - convert xy coordinates to longitude and latitude

14 views
Skip to first unread message

Maarten Schuit

unread,
Mar 15, 2023, 12:18:32 AM3/15/23
to pytroll
Hi Pytrollists,

I'm ingesting Himwari HSD Full Disk data (https://noaa-himawari8.s3.amazonaws.com/index.html#AHI-L1b-FLDK/).
I'm looking at segments 7, 8 and 9.
When I look at the area definition and retrieve the longitude and latitude arrays, the arrays are identical for the different segments. However, the segments cover different parts of the Earth (see Himawari segment description (link) (slide 18)).
Hence, my question is how to get the longitude and latitude coordinates for each pixel for the different segments?
Sample code:

####################################
filename_segment_7 = 'HS_H08_20220101_0000_B01_FLDK_R10_S0710.DAT'
filename_segment_9 = 'HS_H08_20220101_0000_B01_FLDK_R10_S0910.DAT'

scene_segment_7 = satpy.Scene(filenames=[filename_segment_7],
    reader='ahi_hsd',
    reader_kwargs={'mask_space': True})
    scene.load(['B01'])
scene_segment_9 = satpy.Scene(filenames=[filename_segment_9],
    reader='ahi_hsd',
    reader_kwargs={'mask_space': True})
    scene.load(['B01'])

lons_segment_7, lats_segment_7 = scene_segment_7["B01"].attrs['area'].get_lonlats()
lons_segment_9, lats_segment_9 = scene_segment_9["B01"].attrs['area'].get_lonlats()

# Check the latitude and longitude coverage for each segment
lats_segment_7[~np.isinf(lats_segment_7)].min()
lats_segment_9[~np.isinf(lats_segment_9)].min()

lats_segment_7[~np.isinf(lats_segment_7)].max()
lats_segment_9[~np.isinf(lats_segment_9)].max()

lons_segment_7[~np.isinf(lons_segment_7)].min()
lons_segment_9[~np.isinf(lons_segment_9)].min()

lons_segment_7[~np.isinf(lons_segment_7)].max()
lons_segment_9[~np.isinf(lons_segment_9)].max()

# The minimum and maximum longitude and latitude for segment 7 and 9 are identical

####################################

It seems that the longitude and latitude arrays describe almost the entire Earth whilst this is a geostationary satellite and hence doesn't cover the entire Earth. What am I missing here? How to get the longitude and latitude arrays for a specific segment? I would expect that segment 7 covers latitude ranging from 10 degrees South to 21 degrees South.

Any help would be much appreciated!

Kind regards,

Maarten

Martin Raspaud

unread,
Mar 15, 2023, 4:03:37 AM3/15/23
to pyt...@googlegroups.com, Maarten Schuit
Hi Marteen,

By default, satpy will indeed pad geostationary data to full disk. To
avoid that, I think you can use pad_data=False in the reader kwargs.

Best regards,
Martin


On 15/03/2023 05:18, Maarten Schuit wrote:
> Hi Pytrollists,
>
> I'm ingesting Himwari HSD Full Disk data
> (https://noaa-himawari8.s3.amazonaws.com/index.html#AHI-L1b-FLDK/).
> I'm looking at segments 7, 8 and 9.
> When I look at the area definition and retrieve the longitude and
> latitude arrays, the arrays are identical for the different segments.
> However, the segments cover different parts of the Earth (see Himawari
> segment description (link
> <https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjo8pr7hd39AhUHhVYBHRpyAacQFnoECA8QAQ&url=https%3A%2F%2Fwww.data.jma.go.jp%2Fmscweb%2Fen%2Faomsuc6_data%2Foral%2Fst1-02.pdf&usg=AOvVaw1HMO7VtuWXUwoYvE-NvU79>) (slide 18)).
> --
> 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
> <mailto:pytroll+u...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/pytroll/97f4da34-a98a-4a23-9a1c-d16002e62a8bn%40googlegroups.com <https://groups.google.com/d/msgid/pytroll/97f4da34-a98a-4a23-9a1c-d16002e62a8bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

Maarten Schuit

unread,
Mar 15, 2023, 5:54:58 PM3/15/23
to pytroll
Hi Martin,

Thank you for your response. You indeed have to use pad_data=False, but you have to use it in the load method: scene.load(['B01'], pad_data=False). This resulted in the expected/desired behavior. Thank you!

Kind regards,

Maarten
Reply all
Reply to author
Forward
0 new messages