Closed forrestfwilliams closed 3 years ago
@forrestfwilliams thanks for the question. We really need to update the documentation which is outdated. Geogrid can be used with several combination of input files. The possible combinations can be found here. When certain conditions are met, corresponding output variables will be written to a file (e.g. window_*.tif
) otherwise, they will be discarded. For your particular question, yes, slope must be provided in order for search range to be outputted, which is enforced by this check. If only search range is provided without slope, although you might see warnings of divide by zero, the program runs through without crashing, i.e. other variables are outputted properly but search range just won't be written to a file because it is meaningless (divide by zero).
The math behind this can be found in this paper. Refer to Eq 4 (derivation in Appendix A) that converts between velocity (and search range of velocity that is also in unit of m/yr) and pixel offset (and search range in the number of pixels).
So, slope is is a must-have for Geogrid to generate search range. However, it is strictly required for radar images with range/azimuth geometry; for optical images, both DEM and slope can be all-zero-value images.
Thank you for this explanation @leiyangleon. I am happy for this issue to be closed now.
If testGeogrid_ISCE.py is run with search range files but not slope files, a divide by zero error occurs. Looking at lines 565-576 of GeogridOptical.py:
If self.dhdxname is not specified, the normal vector is set to an array of zeroes, which results in divide by zero errors at lines 575 and 576 if self.srxname is specified. Must slope always be specified if the search range option is used?