Snap2stamps package: a free tool to automate the SNAP-StaMPS Workflow

thank you for the response and testing at your side.

I run everything from scratch, including mt_prep_snap and stamps(1,1) and it seems fine until this step.
I deleted all previous versions of stamps, as well as links. After sourcing the CONFIG file, the new scripts are callable from the shell
All data is correctly exported, the preparation shows no zero amplitude pixels and reasonable mean amplitudes, in MATLAB the ‘insar_processor’ is snap, the initial baselines make sense.
But the error remains.

I’ll try a different case area.

Seems to work now. My previous area was near the coast so the SRTM might have been insufficient.
I am at step 2 now and will report when I completed the processing with StaMPS v4.1b

1 Like

Regarding the ps_load_initial_gamma I do not remember to had modified it. So it should work as it is. Let me know if this is not the case and I will share my mt_prep_gamma and ps_load scripts.

Regarding DEMs, indeed the use of a more accurate and updated DEM is better, but it becomes more important when working with higher resolution SAR (X-band stripmap for example). Indeed there are many DEMs that could be used, ie: SRTM DEM (3 or 1 arc second), ALOS DEM, TanDEM-X, etc , but always in GeoTIFF for being used using SNAP.

Can we add an aoiWKT to splitting slaves graph?
Currently the slaves are split but all the bursts are kept. Bursts are only extracted during co-regestration where only bursts overlapping with the master are kept. This creates unnecessary size and processing requirements.
The splitting slaves graph can then in fact be used to split the master too the the requirements of the project.conf file.

Yes, why not!
Had you successfully use it on any test before?
I have tried to use it just yesterday and I got an error.
So, if you provide me with a working example I will do it for next release.

One question, what happens if the AOI it between two subswaths?

1 Like

I quickly cloned your package to https://github.com/andretheronsa/snap2stamps and made the changes I think are needed and tested it once and it seems to work! It splits MUCH quicker for small study areas since it only processes the required bursts. I havn’t done the next steps yet, so not 100% sure having less burst would break the next steps. I assume as long as you have more than one burst it will work (less then one would make ESD coreg fail right?)

TOPSAR-split only uses the AOI to select bursts, so I don’t think it matters if it is out of bounds or in another swath, it only looks for intersecting bursts in the current swath.

Summary of changes: (Only small changes needed)
splitting_slaves.py now reads the polygon data in too (from line 46) with the code from coreg_ifg_topsar.py;

  if "LONMIN" in line:
  	LONMIN = line.split('=')[1].strip()
            if "LATMIN" in line:
                    LATMIN = line.split('=')[1].strip()
            if "LONMAX" in line:
                    LONMAX = line.split('=')[1].strip()
            if "LATMAX" in line:
                    LATMAX = line.split('=')[1].strip()

polygon=‘POLYGON ((’+LONMIN+’ ‘+LATMIN+’,’+LONMAX+’ ‘+LATMIN+’,’+LONMAX+’ ‘+LATMAX+’,’+LONMIN+’ ‘+LATMAX+’,’+LONMIN+’ ‘+LATMIN+’))’

slave_assemble_split_apply_orbit.xml and slave_split_apply_orbit.xml gets polygon added to node id =TOPSAR split(1/2): (this example I had to add a space between the arrows to work on this forum)

< wktAOI > POLYGON < / wktAOI >

This way the python script reads the project.conf polygon and gives it to the graph to run extract only the relevant bursts.

I think this way the master can also be prepared with the splitting slaves scripts but not sure how you would incorporate this.

I just tested it once with an AOI that overlaps 3 bursts, no time for proper testing sorry, on my way for a holiday break. Enjoy!

1 Like

Yes, indeed this is exactly what I have done, but still I got SNAP error on the TOPSAR-Split operator. I will give a try on other machine.

Thanks

I’d like to share what I found relating to use SNAP AND StaMPS, I think those two articles are good answer for many questions, I don’t know in case of they have been posted before, but anyhow, I’d like to post them once more,

Foumelis_et_al_IGARSS2018_SNAP-StaMPS[42].pdf (591.3 KB)

Hallo @mdelgado thank for snap2stamps.
I already run splitting_slaves.py and slaves_prep.py it’s going well no have problem. But when I try coreg_ifg_topsar.py I found some problem:
Error: [NodeId: Subset(2)] Operator ‘SubsetOp’: Could not parse geometry.

can you tell me what’s wrong with my step?
I already try various name format for master.

error:

master name format:
image

Thank for everything…

It could be related to the coordinates defined in the config file. Can you please share it here as well?

1 Like

Thanks @ABraun. In fact I suspect that the error should come from there.
Let us know

Thank you @ABraun and @mdelgado for your reply.
I just fix my config file, but found another error I think it come from my memory not enough.

image

The Master image should not contain IW3…
I think this is creating the issue.
I hope this helps
Best regards

Hi,

Do you have the Docker image available somewhere on Docker Hub? @andretheronsa I am trying to achieve exactly the same.

First of all, thanks for your work on snap2stamps @mdelgado ! When I try to run the scripts with 2 sample S-1 images, the scripts run without error, but they do not produce any output. When trying coreg_if_topsar.py script, I get the following error:

 Error: [NodeId: Subset(2)] Operator 'SubsetOp': Could not parse geometry.

Here is my config file:

Could the problem originate in not specifying a BBOX? Or is it not necessary?

Thanks

Exactly. You should either defined the BBOX in the project.conf or change the graphxml template from the coreg_ifg_computation.py to use the xml without subset in the name.

Let me know

Works great! Thank you. I also used the scripts in Python 3, after some simple adjustments, which works fine.

2 Likes

Do you feel like contributing on the next package version for supporting also python 3?
Feel free to share with us your code. Now I am just developing new improvements but always only for the version 2.7.

Thanks

@mdelgado Yes I would love to! I will send you the python 3 code for the current version and would not mind contributing for the next package version. Just tell me how to get in touch.

Thanks

hello~~Thank for snap2StaMPS again.
I wanna ask a question about “SNAP2StaMPS_CONFIG.bash”
Should I add it to ~/.bashrc before the python process?

Is it not strictly necessary to use the SNAP2StaMPS_CONFIG.bash, you could directly add to the PATH variable the bin folder containing the python scripts of the package.

But once modified the SNAP2StaMPS_CONFIG.bash file (if you want to use it), yes, you can add it into the .bashrc for avoiding to load it every time.

I hope I have answered your question

1 Like