Satpy: ingesting files that span multiple timestamps

15 views
Skip to first unread message

Maarten Schuit

unread,
Mar 21, 2023, 9:38:29 PM3/21/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 band B01 and segment 09.
I create a scene object using the code below. 

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

scene= satpy.Scene(filenames=files
    reader='ahi_hsd',
    reader_kwargs={'mask_space': True})
    scene.load(['B01'], , pad_data=False)

cropped_scene = scene.crop(ll_bbox=(min_long, min_lat, max_long, max_lat))
data_array = scene['B01'].values

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

The question is, if I have files that span multiple timestamps (e.g. 00:00, 00:10, .... 13:00), how can I retrieve the data array that contains all these timestamps? Now, the data array is just a 2D array i.e. the arrays of the various timestamps are not stacked. How do I achieve this?

Many thanks in advance for your efforts!

Kind regards,

Maarten



David Hoese

unread,
Mar 21, 2023, 10:35:18 PM3/21/23
to pyt...@googlegroups.com
Hi Maarten,

It may depend on what you want as your end result after you have the DataArray. In the case of geostationary data like AHI, a `Scene` object is only meant to handle a single time step for a single region (ex. all bands for the full disk at time X).

If you want to work with multiple time steps then I would suggest looking at the MultiScene:

https://satpy.readthedocs.io/en/stable/multiscene.html

And perhaps using the `.from_files` method to automatically sort files into per-Scene groups. You could use the `.blend` method with the `timeseries` function to merge the time steps into a single DataArray with a new "time" dimension. See the "Timeseries" section on the above documentation page. You could also take this blended Scene (the one that has the DataArrays with the time dimension) and convert it to an xarray Dataset with `Scene.to_xarray_dataset()`.

Hopefully this points you in the right direction, but let me know if you have any other questions.

Dave

On 3/21/23 20:38, Maarten Schuit wrote:
> Hi Pytrollists,
>
> I'm ingesting Himwari HSD Full Disk data (https://noaa-himawari8.s3.amazonaws.com/index.html#AHI-L1b-FLDK/ <https://noaa-himawari8.s3.amazonaws.com/index.html#AHI-L1b-FLDK/>).
> I'm looking at band B01 and segment 09.
> I create a scene object using the code below.
>
> #####################################
>
> scene= satpy.Scene(filenames=files
>     reader='ahi_hsd',
>     reader_kwargs={'mask_space': True})
>     scene.load(['B01'], , pad_data=False)
>
> cropped_scene = scene.crop(ll_bbox=(min_long, min_lat, max_long, max_lat))
> data_array = scene['B01'].values
>
> #####################################
>
> The question is, if I have files that span multiple timestamps (e.g. 00:00, 00:10, .... 13:00), how can I retrieve the data array that contains all these timestamps? Now, the data array is just a 2D array i.e. the arrays of the various timestamps are not stacked. How do I achieve this?
>
> Many thanks in advance for your efforts!
>
> Kind regards,
>
> Maarten
>
>
>
> --
> 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/4cb79b44-2515-4ae6-99ab-ddccaa12b674n%40googlegroups.com <https://groups.google.com/d/msgid/pytroll/4cb79b44-2515-4ae6-99ab-ddccaa12b674n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Maarten Schuit

unread,
Mar 21, 2023, 11:10:36 PM3/21/23
to pyt...@googlegroups.com
Thank you Dave, will give that a try!

Kind regards,

Maarten


You received this message because you are subscribed to a topic in the Google Groups "pytroll" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pytroll/4MEj2etx10w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pytroll+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/pytroll/4794db18-ce9f-c37e-7551-97864f912235%40gmail.com.
Reply all
Reply to author
Forward
0 new messages