pyrocko / kite

InSAR unwrapped surface displacement processing for earthquake modelling.
https://pyrocko.org/kite/
GNU General Public License v3.0
78 stars 34 forks source link

Covariance : Singular Matrix while loading scene #122

Closed SonicxPrime closed 4 months ago

SonicxPrime commented 4 months ago

Hi everyone,

We are trying to import SNAP tif result into Kite. At the moment, we don't have the [NEU].tif file. We don't know how to do it yet in SNAP. Any idea is welcome.

First, while loading the tif file in Kite, it is complaining about Covariance : Singular Matrix: Kite_Error

Another error is while going in the Scene.APS tab, it is complainign about the AttributeError: module 'pyrocko.dataset.topo.srtmgl3' has no attribute 'covers': srtmgl3

Sincerely, Tahina

hvasbath commented 4 months ago

Dear Tahina,

unfortunately, for now KITE does not have functionality for the import of data processed with SNAP. You would need to extend the scene_io.py module with a SNAP class. https://pyrocko.org/kite/docs/current/reference/kite.scene.html#module-kite.scene_io

As far as I am aware no one from the current developer team will have time to implement that, but we may find time to guide you in case you want to give it a shot.

Best regards, Hannes

SonicxPrime commented 4 months ago

Dear Hannes,

Thank you for your response. Yes, i would like to try that solution if you can guide me.

Best regards, Tahina

hvasbath commented 4 months ago

Hi again, I just vaguely remembered that there may be this option in SNAP to export your file to GAMMA format. Can you check please? Then you could use this as a workaround, because GAMMA format is supported by KITE. One thing that I can see from the image above is that you need to make sure that your pixels that have no-data should be of NaN value, not zero as above. Thats also why the singular matrix occurs. But this zero assignment to pixels is likely the result of the misinterpretation of the data.

If that does not work we will likely need to find a time slot that works for both of us to meet via zoom/skype/itsi whatever is available to you to discuss the roadmap for implementation.

Cheers! Hannes

SonicxPrime commented 4 months ago

Dear Hannes,

We tried to export our file to GAMMA format in SNAP and we get this error:

Gamma_error

I think the only format that Kite can open here is when exporting it to *.tiff file.

Best regards, Tahina

hvasbath commented 4 months ago

The file .par is the parameter file not the image. So you need to try to load the exported image data. See here for expected inputs: https://pyrocko.org/kite/docs/current/reference/kite.scene.html#kite.scene_io.Gamma

SonicxPrime commented 4 months ago

I have all the files here: Screenshot from 2024-02-22 09-30-55

hvasbath commented 4 months ago

Incidence angle files need to be named with names including "phi" and "theta", then spool --load=displacement_VV.rslc may work, however, I would not expect the unwrapped geocoded displacement map to be be a complex image as suggested by the .rslc ending. You cannot import wrapped interferograms, but unwrapped displacements which should be only of float format.

SonicxPrime commented 4 months ago

Following your advice. I still get the error here: Screenshot from 2024-02-22 10-45-33

hvasbath commented 4 months ago

I was successful importing my own data following the export to gamma format from SNAP. Likely you are missing files, you need to make sure to create them beforehand in your data container within snap. Screenshot from 2024-02-22 13-38-56

SonicxPrime commented 4 months ago

Thank you for your response. I will try to get these files and let you know when it's done.

Best regards, Tahina

SonicxPrime commented 4 months ago

Dear Hannes,

I applied the Terrain correction from the Unwrapped data. I still have this. Maybe still have missing files?

Screenshot from 2024-02-23 07-10-15

Best regards, Tahina

hvasbath commented 4 months ago

the abstracted metadata file is needed

SonicxPrime commented 4 months ago

Wow! It's working. Many thanks. But there is still this one problem about AttributeError: module 'pyrocko.dataset.topo.srtmgl3' has no attribute 'covers' while going through Scene.APS:

Screenshot from 2024-02-23 07-57-25

Screenshot from 2024-02-23 07-57-15

Screenshot from 2024-02-23 07-58-17

Best regards, Tahina

emolch commented 4 months ago

Sorry, that one's my fault. It is due to a recent change in Pyrocko. I will provide a fix.

SonicxPrime commented 4 months ago

Ok. Great

emolch commented 4 months ago

Hi Tahina,

Apparently, I have already fixed this in a commit (35404937a2370b9ea706af9292897ddc27a1118a) from beginning of December. Could you please check if the error is solved when installing the current master branch of Kite?

Best regards Sebastian

SonicxPrime commented 4 months ago

Dear Sebastian,

I upgraded kite to 1.5.8 and It is working now.

Screenshot from 2024-03-12 09-23-55

Many thanks.

Best regards, Tahina