You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Loading of DNB data with viirs_compact reader is slow. Loading of one granule (768 scanlines of 4064 measurements) takes a bit over 7 seconds. As the below snippet demonstrates, everything is done lazily and no dask compute() calls are made.
To Reproduce
importglobimporttimeimportdaskfromsatpyimportScenefrompyresample.test.utilsimportCustomSchedulerfnames=sorted(glob.glob('/home/lahtinep/data/satellite/new/SVDNBC*b41281*'))
glbl=Scene(reader='viirs_compact', filenames=fnames[0:1])
tic=time.time()
# This will raise an exception if any `compute()` calls are madewithdask.config.set(scheduler=CustomScheduler(max_computes=0)):
glbl.load(['DNB'])
print(time.time() -tic)
Expected behavior
The .load() call should be almost instantaneous.
Actual results
The "lazy" .load() call takes 7 seconds per granule. For hncc_dnb composite this is even worse, 23 s per granule. I ran some profiling and found that satpy.readers.viirs_compact.expand_array() is the one taking the time. This function is called by both VIIRSCompactFileHandler.navigate() and, in addition twice VIIRSCompactFileHandler.angles() for hncc_dnb .
Additional context
I still have old versions of satpy/dask/xarray in operations which seems to do this fast (less than a second for 10 DNB granules). The versions there are:
Satpy version: 0.11.2+11.g7047b8d
Dask version: 1.1.0
Xarray version: 0.11.3
The text was updated successfully, but these errors were encountered:
On my new server I have satpy 0.17.2 from conda-forge, dask 2.5.2, and xarray 0.13.0, and there the loading is practically instantaneous. Now I have locally these same versions, but it's still slow. Weird.
I read the logs too hastily. The loading of DNB granules in this format has always been rathers slow. The logs just weren't clear on when there are calls and when cached values are used. But anyway, @mraspaud speeded up things quite nicely in the linked PR, so this wasn't all for nothing 😂
Describe the bug
Loading of DNB data with
viirs_compact
reader is slow. Loading of one granule (768 scanlines of 4064 measurements) takes a bit over 7 seconds. As the below snippet demonstrates, everything is done lazily and no daskcompute()
calls are made.To Reproduce
Expected behavior
The
.load()
call should be almost instantaneous.Actual results
The "lazy"
.load()
call takes 7 seconds per granule. Forhncc_dnb
composite this is even worse, 23 s per granule. I ran some profiling and found thatsatpy.readers.viirs_compact.expand_array()
is the one taking the time. This function is called by bothVIIRSCompactFileHandler.navigate()
and, in addition twiceVIIRSCompactFileHandler.angles()
forhncc_dnb
.Profiling
Environment Info:
master
branch )Additional context
I still have old versions of satpy/dask/xarray in operations which seems to do this fast (less than a second for 10 DNB granules). The versions there are:
The text was updated successfully, but these errors were encountered: