-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problems in geocoding wrapped interferograms in complex type #955
Comments
👋 Thanks for opening your first issue here! Please filled out the template with as much details as possible. We appreciate that you took the time to contribute! |
Thank you @comma-never-coma for the reporting and fixing! I am able to reproduce your error and solution. This is because mintpy (and pyresample I guess) was NOT designed to resample complex data arrays. The following generalization of your solution should work. Could you please issue an pull request in both mintpy and pyresample for this?
dsDict[dsName] = np.zeros((res_obj.length, res_obj.width)) to: dsDict[dsName] = np.zeros((res_obj.length, res_obj.width), dtype=atr['DATA_TYPE'])
full_result = np.ones(output_raw_shape) * fill_value to: full_result = np.ones(output_raw_shape, dtype=data.dtype) * fill_value |
Thanks for your suggestion! I have issued a pull request in both mintpy and pysample. I'm sorry because this is my first time to make a PR and I'm not sure if there would be something wrong. |
Thank you @comma-never-coma, your PRs look good to me. |
Description of the problem
I am trying to geocode ISCE-2 interferograms using
geocode.py
, and I just run the example commend obtained fromgeocode.py
as follows.Full script that generated the error
The program runs successfully, however the wrapped phase in a geocoded interferogram is incorrect. Phase values after geocoding change into 3.14, which is the same as pi. Give the interferograms below.
And there appears some unexpected messages
ComplexWarning
in the terminal, this is the output:Full error message
According to the error message, I modified the line 823 in
kd_tree.py
and line 103 ingeocode.py
, to adddtype = 'complex_'
while creating the matrix, just like:full_result = np.ones(output_raw_shape, dtype = 'complex_') * fill_value # line 823 in kd_tree.py
dsDict[dsName] = np.zeros((res_obj.length, res_obj.width), dtype = 'complex_') # line 103 in geocode.py
Under the condition
dtype = 'complex_'
, I got a correct geocoded interferogram withgeocode.py
as below:At the same time, it would generate the same
ComplexWarning
under the conditiondtype = 'complex_'
if we try to geocode unwrapped interferograms or coherence maps whose data type is actually not complex. But the output data seems to be true although there is aComplexWarning
.System information
The text was updated successfully, but these errors were encountered: