bcdev / snap-idepix

Collection of IdePix pixel classification modules for various sensors
GNU General Public License v3.0
4 stars 1 forks source link

Idepix olci cloud shadow fronts optimizations #35

Closed heptaflar closed 3 years ago

heptaflar commented 3 years ago

While copying a lot of the OLCI cloud shadow code to my OLCI AC branch, I found many small (potential) optimisations and also cleaned up the code a bit. Not sure, however, if the optimisations have a measurable effect.

I reduced the number of calls to computationally relatively expensive trigonometric functions to 1/4, eleminated all calls to the also expensive pow() and avoided calls to tile.getSample() methods whenever possible. I further rearranged all loops to follow the 'first y then x principle'. Open for review.

heptaflar commented 3 years ago

Meanwhile, I fixed a bug and found another potential improvement. I also tested essentially the same code on my branch of the S3TBX OLCI Atmospheric correction, where I needed an operator, which computes cloud buffer and cloud shadow only.

heptaflar commented 3 years ago

I also tested this code. Seems to work well,

marpet commented 3 years ago

The result is different to the master. There are now some more cloud_shadow pixels. Performance improvements is negligible. 2 seconds faster when running 1370 seconds overall.