ASFHyP3 / hyp3-autorift

A HyP3 plugin for feature tracking processing with AutoRIFT-ISCE
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Improve performance of crop #230

Closed jhkennedy closed 1 year ago

jhkennedy commented 1 year ago

Cropping some of the Golden Test netCDF files takes over 10 minutes to perform, which seems ridiculously long.

Profiling the script on

LC08_L1TP_009011_20200703_20200913_02_T1_X_LC08_L1TP_009011_20200820_20200905_02_T1_G0120V02_P078_IL_ASF_OD.nc

shows 99.8% of the wallclock time is spent in the where method here: https://github.com/ASFHyP3/hyp3-autorift/blob/bf2c3d75370aacf2c807675c98cb3fd5f13a357f/hyp3_autorift/crop.py#L78

jhkennedy commented 1 year ago

Alternatively, we could subset/crop the data before we write the original netCDF product file in netcdf_output.py.

Arguably, this is the correct way to do it, but it'd require digging through 1440 lines of vendored python code to figure out how and where to do this.