In this tutorial, we will read MSG data and display a few composites and channels, in satellite projection and on predefined areas.
If you went through the installation procedure described in tutorial 0, you should be all set up :)
from satpy import Scene, find_files_and_readers files = find_files_and_readers(base_dir='/tcenas/scratch/pytroll/ex1/', reader='seviri_l1b_native') scn = Scene(filenames=files)
To list the available datasets run 'available_composite_names' method
Then we decide on a composite to load and display it on screen. To get the list of available composites, use the
composite = 'natural_color' scn.load([composite]) scn.show(composite)
The loaded composite is a
DataArray from the
xarray library, containing the data, the projection coordinates of the pixels and some metadata.
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
newscn = scn.resample('euro4', radius_of_influence=20000)
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.
Alternatively, one can specify the filename to save to (and using the proper extension, the format).
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
scn.load([10.8, 12.0]) scn['t11-t12'] = scn[10.8] - scn[12.0] scn.show('t11-t12')
Try to resample
t11-t12, and if it doesn't work, try to fix it :)
(Hint: look at the metadata)