pytroll / satpy

Python package for earth-observing satellite data processing
http://satpy.readthedocs.org/en/latest/
GNU General Public License v3.0
1.06k stars 294 forks source link

Slow loading speed of TROPOMI L2 product #2241

Closed zxdawn closed 1 year ago

zxdawn commented 2 years ago

Describe the bug

It costs a lot of time when loading variables of TROPOMI L2 product.

To Reproduce

# Your code here
import time
from satpy import Scene

start = time.time()
scn = Scene(['S5P_PAL__L2__NO2____20190811T022605_20190811T040734_09459_01_020301_20211110T023157.nc'], reader='tropomi_l2')
start = time.time()
scn.load(['time_utc', 'longitude', 'latitude', 'solar_zenith_angle', 'viewing_zenith_angle',
          'tm5_constant_a', 'tm5_constant_b', 'tm5_tropopause_layer_index',
          'surface_pressure', 'cloud_pressure_crb', 'apparent_scene_pressure',
          'air_mass_factor_stratosphere', 'nitrogendioxide_stratospheric_column', 'nitrogendioxide_slant_column_density',
          'cloud_radiance_fraction_nitrogendioxide_window', 'processing_quality_flags'])
print(time.time()-start)

Expected behavior

Because the scn.load() is lazy loading, the speed should be faster if I understand correctly.

Actual results

It costs about 18s.

Environment Info:

mraspaud commented 2 years ago

@zxdawn thanks for reporting this. We just had a discussion last week about the same issue for FCI, and although the readers are different, there might be common ground for this. Maybe something we could look at during the PCW next month?

zxdawn commented 2 years ago

@mraspaud Ha, thanks for the notification. Then, maybe it's related to the nc reader. I will take a look and may give feedback during PCW.

zxdawn commented 1 year ago

Well ... I tested the script on another node. It costs only 2.6 seconds. It seems there were some other node tasks affecting the running speed last time. Close now and will open if I met the same issue again.