Closed alma-pi closed 2 months ago
Thanks @alma-pi! This is a great optimization. I'll update this issue when we get it into the code, and it should be out with the next release.
@alma-pi this change you outlined has been made and pushed. It didn't make it into this past release, but will come out with the next release.
After implementing your change, I saw a significant speed up in atl03 processing calls; on the order of ~60 second requests going to ~35 seconds.
In sliderule/clients/python/sliderule/icesat2.py, the 'spot' column is calculated using geopandas.apply and the __calcspot function. Using pandas.Series.map here instead should be much faster.
For a granule of about 2 million photons, this takes about 19s. Using a dictionary and pandas.Series.map takes less than 2s:
Pandas map function returns NaNs in case of missing keys.
It's also possible to change the current function to accept a tuple as input. Along the lines of: