Workflow between SNAP and StaMPS

Hello, I would like to get help with the ps_shapefile function, someone can give me an example of its execution. I’m not sure what each parameter represents, especially step.

function ps_shapefile(filename,data,step)

hmm, there are two tie-point grids with this name already. I am not sure how the stamps export handles this. Try to rename the tie-point grids and add the lat/lon bands afterwards.

Hello again!

This might be a stupid question, but can you please tell me how to rename bands?

I tried to use just Lat and Long names to create new bands, but Stamps export is giving same error. I will try to create the interferograms again with topo phase removal step combined.

Thank you!

currently, the problem is that the tie-point grids are named like the bands which are currently missed by the StaMPS export.
You can right-click on the tie-point grids and rename them to latitude_y and longitude_x, for example so that you can use the band maths afterwards and give the actual bands the names latidude and longitude.

However, this should not be a problem in the normal StaMPS preparation. Which workflow did you follow? Anything you made different maybe?

1 Like

Hi!

I was able to rename the tie-point grids and add new latitude longitude bands. Still, I am having the same error. Image attached.

I don’t think I did anything different this time. Only thing I added was I merged two sub swaths. This is the workflow -

For both IW2 and IW3:

TOPSAR split
Orbit file
Single master stack
Enhanced spectral diversity
Interferogram formation with topo phase removal (Did not add elevation or lat long bands)
TOPSAR deburst

TOPSAR merge both IW2 and IW3
Add elevation band
Rename tie-point grids
Add lat long bands

Can you please tell me if this was right method or I did mess somewhere?

Thank you for help!

I have tested your issue for a simple case (only 2 products - makes no sense but is technically the same)

Reproduction of your error

  1. Split IW1
  2. Split IW2
  3. Backgeocoding IW1
  4. Backgeocoding IW2
  5. ESD IW1
  6. ESD IW2
  7. Inteferogram IW1 (including export of lat/lon/dem)
  8. Inteferogram IW2 (including export of lat/lon/dem)
  9. Deburst IW1
  10. Deburst IW2
  11. TOPS Merge

After the merge, both elevation and the coordinate layers are gone - like in your case.

grafik

Solution

However, I noticed that the product name of the lat/lon bands is not latitude and longitude (as I initially thought), but orthorectifiedLat and orthorectifiedLon.

grafik

Maybe you can perform the merge again and then create bands with these names (in the context menu [add elevation band] and band maths [advanced expression editor > shor tie-point-grids]).

I tested it and added the bands after the merge:
grafik

and finally saved the product (this takes some time)
grafik

and there is no longer an error message:

grafik

Result

These are the exported folders
grafik

dem
grafik

diff0
grafik

geo
grafik

rslc
grafik

1 Like

Ok, so I think I know what the problem is. The problem lies in saving the orthorectified lat long bands. On my software, when I add the bands, they look fine. When I saved elevation band, it saved properly. But when I tried to save lat long bands, there is no (saving…) window appearing. Even then, when I closed the stack and opened it again, both lat long bands are there. Can you please tell me what can I do to save the bands properly?

I just noticed a tiny difference. You have used the O letter small, while I have used capital. I will try again with small O to see if that makes a difference,

Hi!

I have some updates. Stamps export finally worked! There were a few reasons for stamps to not work:

  1. When we create lat long bands, we need to convert them. Right click > convert. Then only the bands will save.
  2. Names of bands should be ‘orthorectifiedLat’ and ‘orthorectifiedLon’. I was using capital O instead of small O and Long instead of Lon.

Thank you for all the help! I believe that Stamps should run smoothly from now on.

1 Like

great that you found out. Converting the virtual bands to physical ones is probably important. THanks for pointing it out and good luck for the further processing!

2 Likes

@ABraun :excuse me, do the enviroment of snap2stamps package run ?
More question:where did you download snap for linux ,I find it only for windows and nuix http://step.esa.int/main/download/snap-download,Can you tell me.?

https://www.gis-blog.com/how-to-install-esa-snap-on-ubuntu-linux/

I think this will help.

Hello!

Stamps worked properly upto step 7! But the images were somehow incomplete so I am now trying to process the subset instead of two whole swaths. However, when I created the subsets and then tried Stamps export, I get this error (Image attached). Does subsetting removes the geocoding and other necessary information? Can you please help me?

Also, I noticed that something might be wrong with the stack itself (Before interferogram and dinsar). When I tried to create subsets, I am getting this image in the subset window. It seems that stack is itself incomplete and therefore, stamps processing is also incomplete. Images are attached for subsets of both stacks (before and after interferogram). I tried to merge that stack many times just to make sure. Can you please help me in that too?

Thank you!

Image of error in Stamps export:

Subset interface with stack before interferogram:
stack_sub

Subset interface for stack after interferogram:
stack_ifg_sub

P.S. - I hope that all of you are safe from Corona virus. Take care.

snap2stamps requires python, please check the official manual: https://github.com/mdelgadoblasco/snap2stamps/blob/master/Manual/SNAP2StaMPS_User_Manual.pdf

1 Like

if you use the same stack for the interefrogram generation, they should be of equal dimension. Applying a subset afterwards will probably only make it worse.

What indicated that the images were incomplete? If you made it to step 7, the problem should be elsewere (and not coming from the dimensions).

Nothing indicated that images were incomplete, but when I got the results after step 7, I saw that the IW3 subswath had not been considered, even when I had merged IW3 and IW2.

Should I apply merge and subset before computing interferograms then? Will that work?

I dont know, sorry. Give it a try!

Merge should be done after deburst (as indicated in the standard graph provided within SNAP) but individual IW interferograms should be ok, so I suggest you test individual IW interferograms before merging.

This will be included in next snap2stamps release

Yes, but my question is “If subsetting after interferogram causes dimension loss, should I merge and subset both subswaths before interferogram?”

Because interferograms stack is looking good even after merging both subswaths. It is the stack with ESD only that does not look good. I am trying to do this method right now: Stack>ESD>Deburst>Merge>Subset>Interferogram>further processing. I do hope that this will work.

No.
Subsetting should be done after Merging.

Split-Coreg-Ifg per each IWs, later Merge and finally subset.
Interferogram is done at IW level. Please check the TOPSAR Coreg Inteferogram IW All Swaths provided in SNAP

BackGeocoding > ESD> Interferogram> Deburst> Merge> Subset and further

2 Likes

thanks a lot .I’v follow the step by install snap6( reference:https://www.gis-blog.com/how-to-install-esa-snap-on-ubuntu-linux/) in ubuntu18,after finished installtion ,nothing appeard,even with ‘snap or sudo snap’ in command line in ‘/snap/bin’ directory,also python 2.7 is installed, Help me please

?

here is the information below:
y@sentinel:~/snap/bin$ snap
The snap command lets you install, configure, refresh and remove snaps.
Snaps are packages that work across many different Linux distributions,
enabling secure delivery and operation of the latest apps and utilities.

Usage: snap […]

Commands can be classified as follows:

     Basics: find, info, install, list, remove
    ...more: refresh, revert, switch, disable, enable
    History: changes, tasks, abort, watch
    Daemons: services, start, stop, restart, logs
   Commands: alias, aliases, unalias, prefer

Configuration: get, set, unset, wait
Account: login, logout, whoami
Permissions: connections, interface, connect, disconnect
Snapshots: saved, save, check-snapshot, restore, forget
Other: version, warnings, okay, ack, known, model, create-cohort
Development: run, pack, try, download, prepare-image

For more information about a command, run 'snap help '.
For a short summary of all commands, run ‘snap help --all’.
y@sentinel:~/snap/bin$