How to call InSARStackOverview in python module. where can I find a documentation about snappy
You can find information in the sticky post of this category
and also here
You can also get to the Developer Guide from the website in the Documentation section.
Actually, I only want to use the function of calculate Baseline (itâs InSAR Stack Overview in desktopďźI just want use it with python ). I want to find best Interference baseline in many files.
could you tell me how to use the functionďź I didnât find in java scripts.
you can load the class as follows
import snappy
InSARStackOverview = snappy.jpy.get_type(org.esa.s1tbx.insar.gpf.InSARStackOverview)
stack_overview = InSARStackOverview()
stack_overview.setInput(âŚ)
But the class InSARStackOverview does not have a calculateBaseline
method. So I donât know what you want to call.
InSAR Stack Overview is doing much more than just calling one method.
However , I can get perpendicular baseline by InSAR Stack Overview
on the desktop. SO, the class InSARStackOverview will be not?
It is not the only one you need to use. But I canât tell you want you need to do. Iâm not working with SAR data.
I just want to realize the InSAR Stack Overview
function of SNAP DESKTOP by snappy.
Maybe @cwong or @timmoorhouse can shed some light o it.
Or maybe someone else did it already?
But you can have a look at our repository and see what needs to be done.
The entry point is the class org.esa.s1tbx.insar.rcp.dialogs.InSARStackOverviewDialog and its method processStack.
Thank you very much. I will try to do it.Thanks
Does anyone found out how to call InSARStackOverview from snappy python?
I get the following error while calling the function, see the snippet below:
InSARStackOverview = snappy.jpy.get_type(âorg.esa.s1tbx.insar.gpf.In
SARStackOverviewâ)
stack_overview = InSARStackOverview()
stack_overview.calculateInSAROverview(insar_stack)
How have you created your insar_stack?
I think it needs to be created like this:
insar_stack=jpy.array('org.esa.snap.core.datamodel.Product', 5)
insar_stack[0] = product1
...
insar_stack[4] = product5
# or loop over it
@marpet Thanks for the reply, below is the full code.
slc_paths = glob.glob(r'C:\Users\Placeholder\Desktop\Pre-Processing_Module\Quering\Download\*.zip')
insar_stack = snappy.jpy.array('org.esa.snap.core.datamodel.Product', len(slc_paths))
for i, slc_path in enumerate(slc_paths):
slc_product = snappy.ProductIO.readProduct(slc_path)
insar_stack[i] = slc_product
InSARStackOverview = snappy.jpy.get_type('org.esa.s1tbx.insar.gpf.InSARStackOverview')
stack_overview = InSARStackOverview()
stack_overview.calculateInSAROverview(insar_stack)
I still get the same error. Please let me know if I am doing something wrong.
Thanks in advance.
Now I see. calculateInSAROverview
is a static method.
Donât use the instance stack_overview
of InSARStackOverview
.
Try directly:
InSARStackOverview.calculateInSAROverview(insar_stack)
@marpet Thanks for your quick reply; I was successful in getting the name of the optimal master product. However, I was curious how I could extract the other data like perpendicular baseline, temporal baseline and modelled coherence.
snippet to get the name of optimal_master
InSARStackOverview = snappy.jpy.get_type(âorg.esa.s1tbx.insar.gpf.InSARStackOverviewâ)
optimal_master = InSARStackOverview.findOptimalMasterProduct(insar_stack).getName()
Thanks in advance
Iâm not familiar wir SAR processing.
So, Iâm also only guessing by looking at the code.
I think you need to call. This gives you an IfgStack array.
ifgStack = InSARStackOverview.calculateInSAROverview(insar_stack)
Each of the entries has a master and a master_slave. You can get the master_slave by
ifgpairs = ifgStack[0].getMasterSlave()
This is an array of IfgPair instances.
On these IfgPair instances you can call
ifgpairs[0].getPerpendicularBaseline()
ifgpairs[0].getTemporalBaseline()
ifgpairs[0].getCoherence()
and more.
See
@marpet Thank you so much, will try them.
Hi,
Iâm using snap10 and python3.10 in linux, having now this error:
ValueError: Java class âeu.esa.microwave.insar.gpf.InSARStackOverviewâ not found.
Any ideas.
Try instead: eu.esa.sar.insar.gpf.InSARStackOverview
The page where this should be mentioned, does not reflect the latest decision for renaming the package.
API and Architectural Changes in SNAP 10 - SNAP - Confluence
Thank you for the quick reply. It works now.
Regards