About import the polsarpro result to the snap

Hi Li,

I think I have not understood you very well, but this afternoon I will work (also) to do a shannon entropy on an IW product with PolSARpro. So…the things that I have not understood very well are that it seems that you are opening the product on PolSARpro…I wont do on that way…First, I will open it on SNAP and I will split the swath i want, then I deburst, and then i subset. Thing here is that the metadata will change automatically during these steps (Also it is interesting to make a graph process with these steps) and it (i suppose) will have the information of the steps.

Then, I will open PolSARpro, and I dont specificate that it is a sentinel-1 product, I open like a single data set, and then input raw binary data. (if you dont understand this step, tell me). I will make the processes I want and I will open the bmp files on S1 Toolbox. Here I will open also the subset that I originally exported from SNAP to PolSARpro and I will replace the metadata…so on this way, I expect to be able to Terrain Correct.

Also I dont know if you really start from a total dataset or from a subset like me. About open on PolSARpro like a single data set is because (i dont know why) PolSARpro doesnt recognise the files I exported from SNAP as a Sentinel data…so I open like a single data set (changing the config txt file that generates SNAP because it has an error…) If you really dont understand this part, tell me.

Anyway I will try this afternoon.

                                   Thanks and keep in contact,

Aridane

Hi,aridane:
I think I can understand your step, it is a good workaround to deal with the S1 data.
I could open the Sentinel 1A data from a total dataset and the images is strange I think when I deal with it,Because it always changes its outlook when situation is different.
If you want to try, you could unzip the slc dataset, and specificate the S1 product , use environment to direct the directory to the .safe files, and ok. and than you could import your images , you could choose one of the swath. and bursts. and than extract it as full resolution or subset it as you want. but just this step, the software always gives different results,because sometimes it debursts all the bursts, some times not ,sometimes with vertical gaps instead of horizonal gap. when the image is decending or asending, the image position will be different. I donnot know why.
But I will try you method, If I have some problem, I will contact you! Thank you!
LI

One note: on my way you have to put in the config txt file where it says PolType: “pp2”, if not, it doesnt work. Also put monostatic when you define input binary raw data and specify the matrix. (This step is a little complex at the start…). Anyway Im doing now. I will tell you.

And I also will try your way, unzipping the SLC, so we will talk!

Aridane

yes, it is complex. Can you tell me the detailed step? you export the polsarpro format from the Snap? and how to know the
lines and rows? I read it from the subset function, am I right? in polsarpro, can you show me the detailed import steps, thank you!
LI

what do you mean by “pp2”?
li

Hi Li,

As I said to you, yes I could, its very easy. The same way I did with Stripmap…although results with IW are not such good, but its ok.

See the screenshots.

As you can see on screenshots, it is possible to work on this way…its very strange because it is like a walkaround the target but…its ok.

The difficult step is to open a subsetted product on PolSARpro…

  1. Export on SNAP the product subsetted (and calibrated, Im not sure if it is mandatory, but I do for the moment) to PolSARpro format. You will find it on the menus.
  2. The folder created by SNAP has one error, where it says PolType: dual, you have to change and put “pp2” on config.txt file. It refers to the type of the data, if it is full (quad pol), dual, or partial (pp1, pp2). Sentinel 1 somentimes is pp1 and others it is pp2, it depends if your product is HH, HV then pp1. If your product is VV, VH, then pp2. Also the config.txt says how many rows and columns has your data and also the type of “monostatic”. It last doesnt matter, simply mean that the antenna transmitter and receiver are on the same spacecraft.
  3. Specify on PolSARpro your folder environment as the one created by SNAP. PolSARpro will say there is no data or something like this: answer no!.
    4)Imput binary raw data: Here you have to put many things: the columns and rows, the monostatic type, and mark S(xx,xy) format. Then, under you have to check (S11, S21) for pp1 or (S22,S12) for pp2. Specify real/imag because this is the SLC data format of Sentinel, bands of real and imaginary. Input the file .bins as i (real) and q(imaginary) for S11, S21 or S22, S12.
  4. Extract full resoulution.

It must work!

Then of course you have to do a Polarimetric Speckle filter. It will produce C2 matrix where you can process many things on PolSARpro…

All these things came from the theory of S2, C2, T2 matrixes…Its a litte difficult at start, but then becomes mechanical

Good luck!

Aridane

how do you do this? as my method to export from polsarpro? do you replace the metadata?

Ehhhm…

See, once you have done the processes you want on PolSARpro, I simply open bmp file on S1 Toolbox. I watch on bmp. Then I open the original product subsetted on SNAP (which one with I exported the folder to PolSARpro) and I make a replace of metadata.

Try!

Aridane

hi,Aridane:
I solved the problem, Thank you !
But there is other problem about why I use this method to generate the shannon entropy or other parameter it is always giving a black image. Is that right for after extracting the image we could go directly to do the polarization decomposition. I could get the c2 matrix, it is right ,but after that no. do you know what is the problem?
But why I can not generate anything,But when I use my method to generate the shannon entropy,it is right ,but with black gaps inside.

li

Hi!

Mmmmmmm…I dont know…but you have to check on PolSARpro where are you working, if you are on SPP (partial scattering matrix) that is the original matrix or C2 (covariance matrix). You can see on a toolbar that is always upside, that says every moment where are you working if C2 or what. Thing here is that for doing decompositions you must be on C2 and also, you must have set all the things right when you do the extract (full resolution), cause, PolSARpro open it although is wrong, showing black images, or strange ones. So check the steps and check where are you working. Of course, some decompositions will be impossible to open because of the dual-partial product. But the shannon entropy is available.

Tell me,

Aridane

Hi Aridane

I am trying to import a bmp file generated in PolSARPro (for example a alpha.bmp) but I am only able to open it by doing File\Import\Generic Formats\RGB Image. However, the opened file doesn’t have a metadata file only Vector Data and Bands

.

Then I open the subset image that I have exported to the PolSARPro format to calculate the decomposition parameters. When I try to replace the metadata file of the bmp file nothing happens!!! As I can see in your example you are able to open the bmp file with just the open product, which I am not able to do because no image appears on the screen! Can you explain me please how can I overcome this issue?

Thank you. Best regards, Ana.

Hi Ana!

Yes of course I can, and sorry, i know that when you press the button replace metadata and nothing happens…it can be a little annoying ;). So, it seems there is a problem with the lasts versions of the snap on this issue. Its a problem of the version. You can do the next:

  1. Open on snap, the same product you exported to polsarpro.
  2. import the bmp file (it must be the two products on the screen at left now.
  3. Do a band math at the product you open first and CREATE a new band with the bmp image of the second product. It seems difficult on the band math operator, but you have to choose the another product. There is a way on the box options to select the another product ok!
  4. With the new band on the original product (that is the bmp file), you can do whatever you want, also the terrain correction.

Try, i hope this helps!

Aridane

1 Like

Hello Aridane

Thank you very much! I have my problem solved!

Best regards,

Ana Navarro

Ana Cristina Navarro Ferreira
Professora Auxiliar
Departamento de Engenharia Geográfica, Geofísica e Energia

[http://www.fc.ul.pt/sites/default/files/fcul/institucional/normas_graficas/Ciencias_UL_Azul_H.png]

Faculdade de Ciências da Universidade de Lisboa
Campo Grande 1749-016 Lisboa · Portugal
T (+351) 217 500 000 * Ext. 28117 F (+351) 217 500 830
info@ciencias.ulisboa.pt
www.ciencias.ulisboa.pt

Hello! Do you know if its possible to do it using a graph?
I would like to do it in graph and then use the command line to run it.
I tried with a BandMerge but it didn work.
Thank you,
Mariela.

Hello Aridane,

I’ve found your answer about “how to import PolSARpro output in S1 toolbox” very interesting. I’ve some questions:

I’m using Sentinel 1 data (SLC dual polarization) and I’ve just worked out the C2 matrix with PolSARpro; than I’ve obtained the S.R.T.M. DEM. Now I need to do terrain correction using S1 toolbox.

  1. Which file of the “C2 folder” shall I use in S1 toolbox?
  2. Have you worked out the anisotropy after or before the terrain correction?

Thank you so much!
Piero

1 Like

If you are importing a matrix from PolSARPro, just open one of the .hdr files. It will look at all files in the folder and treat it as one product.
However, if all you are doing is generating a C2 matrix, SNAP can do that automatically whenever you use a polarimetric operator on a dual pol SLC product or you could also use the polarimetric matrix generation operator.
SNAP also automatically downloads the SRTM tiles you need when terrain correcting.

Hello lveci,

Thank you for your answer! I’ll try it!

Piero

Hello sissizhangli,

I got your problem because I’ve the same one! :confounded:
Could you tell me if you’ve solved it?

Thank you, Piero

I want to geocoding polsarpro products, but I get the errors as this figure. Could you tell me how to solve this problem?

Thanks