Getting started with MSG level 1.5 data, native format


In this tutorial, we will read MSG data and display a few composites and channels, in satellite projection and on predefined areas.

Installation and setup

If you went through the installation procedure described in tutorial 0, you should be all set up :)

Loading some data

The first step is to find the files to load, and to create a Scene instance

In [ ]:
from satpy import Scene, find_files_and_readers

files = find_files_and_readers(base_dir='/tcenas/scratch/pytroll/ex1/',

scn = Scene(filenames=files)

To list the available datasets run 'available_composite_names' method

In [ ]:

Then we decide on a composite to load and display it on screen. To get the list of available composites, use the available_composite_names method.

In [ ]:
In [ ]:
composite = 'natural_color'

The loaded composite is a DataArray from the xarray library, containing the data, the projection coordinates of the pixels and some metadata.

In [ ]:

Exercise 1.1

Load and display other composite, like fog and airmass

Resampling the data

A simple call to the resample method is enough to resample the data to another area. Here, we use the predefined area euro4, but we will see in another tutorial how to customize the areas. Some other predifined areas are euron1, eurol, germ

In [ ]:
newscn = scn.resample('euro4', radius_of_influence=20000)
In [ ]:

Saving the image to disk

The save_dataset method can be used to save the image to disk. Formats supported for writing are some of the standard image formats (png, jpeg), GeoTIFF, NetCDF. The default will be to save to GeoTIFF with a filename based on the composite name and the start time of the scene.

In [ ]:

Alternatively, one can specify the filename to save to (and using the proper extension, the format).

In [ ]:
newscn.save_dataset(composite, filename='really_cool_pic.png')

Working with the individual channels

It is also possible to load the seviri channels individually (using their names or approximate wavelengths in ┬Ám) and work with them. To get the list of available channels, use the available_dataset_names method.

In [ ]:
scn.load([10.8, 12.0])
scn['t11-t12'] = scn[10.8] - scn[12.0]'t11-t12')

Exercise 1.2

Try to resample t11-t12, and if it doesn't work, try to fix it :)

(Hint: look at the metadata)

In [ ]:
In [ ]: