Fabio,
reorganizing my scripts I did some speed testing. As you said
you make different composites, one point that -- as far as I
can see -- has not yet been discussed above. TBH this was rather
new to me as well: If you produce different composites that
you resample to the same area you can load a full composite list
and delay composite generation until you save your images. This
way the different channel datasets are only resampled once which
is time saving if you have a list of composits that share a number
of channels. Below I resampled MSG4 data to my area ='westminster'
(stere, 2048 x 2048 pixels) using the following composite list:
composites = ['natural_color', 'dust', 'fog', 'green_snow', 'ir_sandwich']
I made two scripts that work under Devuan Beowulf GNU/Linux as follows:
MSG4-S.py
for composite in composites:
files = find all files necessary for the single composite at hand
global_scene = Scene(filenames = files, reader = 'seviri_l1b_hrit')
global_scene.load([composite], upper_right_corner = 'NE')
new_scene = global_scene.resample(area, radius_of_influence = 20000)
my_overlays = produce overlay dict for coastlines, rivers, borders, points, ...
new_scene.save_dataset(composite, 'MSG4.png', overlay = {'coast_dir': dbroot, 'overlays' : my_overlays})
Additional ImageMagick step to produce legend at left and save final result as *.jpg
MSG4-X.py
files = find all files necessary for the whole list of composites
global_scene = Scene(filenames = files, reader = 'seviri_l1b_hrit')
global_scene.load(composites, upper_right_corner = 'NE', generate = False)
new_scene = global_scene.resample(area, radius_of_influence = 20000)
my_overlays = produce overlay dict for coastlines, rivers, borders, points, ...
for composite in composites:
new_scene.save_dataset(composite, 'MSG4.png', overlay = {'coast_dir': dbroot, 'overlays' : my_overlays})
Additional ImageMagick step to produce legend at left and save final result as *.jpg
I get the following results on a 10 year old I7 with 16GB of RAM that is
used as an EUMETCast receiver and also makes images and movies croned:
MSG4-S.py
1) All files used by every composite in the loop have to be decompressed
This way some/many(?) files have to be xRITDecompressed several times
SatPy caching: Proj-cache=False (GEO sats only), Overlay-cache=False
Time (real) for generation of all 5 composites: 1Min 37sec
2) Decompressed files are cached if already used by some composite before
This way files needed in the loop have to be xRITDecompressed only once
SatPy caching: Proj-cache=False (GEO sats only), Overlay-cache=False
Time (real) for generation of all 5 composites: 1Min 26sec
3) All xrit files needed in the loop have been decompressed beforehand
SatPy caching: Proj-cache=False (GEO sats only), Overlay-cache=False
Time (real) for generation of all 5 composites: 1Min 11sec
MSG4-X.py
4) All xrit files needed for composites have been decompressed beforehand
SatPy caching: Proj-cache=False (GEO sats only), Overlay-cache=False
Time (real) for generation of all 5 composites: 56sec
5) All xrit files needed for composites have been decompressed beforehand
SatPy caching: Proj-cache=True (GEO sats only), Overlay-cache=False
Time (real) for generation of all 5 composites: 40sec
6) All xrit files needed for composites have been decompressed beforehand
SatPy caching: Proj-cache=True (GEO sats only), Overlay-cache=True
Time (real) for generation of all 5 composites: 35sec
Results are attached below. Original image size is 2401 x 2048 pixels.
Maybe MSG4-X.py is what you already do. For me it's an big step forward.
Best regards,
Ernst