About import the polsarpro result to the snap

When I import the result of polsarpro, such as the shannon entropy. I want to do Terrain correction in snap. but I always stopped at the “replace the metadata” function. Can you tell me “the same dimension” means what? the pixel size or the size of the image. I try many times, it is not work. Thank you!

Hi!

Do you really could import the PolSARpro data onto SNAP?? I have not reach that point…! How did you do?

Many thanks in advance,
Aridane

yes, just open the .hdr file is ok. but we need to change the parameter to have a right metadata. but that step is not get though now

Hi!

I tried so many times to open the hdr files with the SNAP (last version) but anything happens…I will try to geocode and terrain correct with PolSARpro, because it can do it for other missions such as Radarsat or Terrasar…but I really doubt it will work for Sentinel…

Hi,

I tried to open a bmp file made by PolSARpro on S1-Toolbox (last version of the S1) and it worked, so I I replaced the metadata opening and choosing the original product that I exported to PolSARpro by SNAP (they have to have same dimensions). Once I had got it replaced, then I did terrain correction, and then established the colour palette on the colour manipulation toolbar.

It works, then I made a Kml file for Google Earth so… perfect!

Aridane

why when I use the replace data, It always mention me to have same dimension,can you show me your two images, one is from the polSARpro, one is from snap the one whose metadata is replaced. I need to make sure of it.

Ehy,

I have done like you can see on the next screenshots…just use the S1 Toolbox. The thing about the dimensions is that you HAVE TO use the metadata of the product that you exported to PolSARpro…of course, don´t change the dimensions on polSARpro…if the dimensions change…my solution doesnt work. But try like this, and then you can do Terrain Correction or whatever, it really works.

One more thing, remember that you are working with a bmp file, so it is a bit map…sometimes it could be of 24 bits or 8 bits, so thee colour deep is higher or lower… The thing is that on S1 Toolbox you can manage the palette colour. For example, when you do a Wishart Classificator on PolSARpro, maybe of five classes on your image (you will have only five colours)…the S1 Toolbox opens the bmp and doesnt understand that the colours are discrete, software just range the colours according to the valours of the bits…so in this case, you have to exe the colour manipulation and check “Discrete colours”.

Last screenshot is about a stripmap product that I classified (test) with wihart with three classes, as you see, the colours are discrete. I made the TC on S1 Toolbox.

Try and tell me,

Aridane

<img src="/uploads/default/original/1X/0935f109e3fa1b8276e7461ea90d6c4b70e3e630.PNG" width=“690” height=“453”

1 Like

Thank you very much,aridane. Here my question is about the dimension, I saw your two images are the same size or the same area. Is that means the dimension. How to keep dimensions on polSARpro? I never Change any thing ,just Choose Sentinel function, and Environment using the Extracted Sentinel 1A IW SLC data. And Import it ,Choose one of the swath,and then extract full resolution, generate Shannon entropy. In PolSARpro, the image’s position changes after extraction. And I saw your original image is a subseted one, this is because you want to have a same dimension? I saw you use the SM mode data, I am not sure if it is the same as IW mode. Because IW mode the the TOPS,with swath and several bursts. The original data is consist of several parts. I will show it to you as the followed pics:
1,This is the quick look of the image of one swath of S1A IW mode data


2,after I extract it,it will changed to a strange one, I will show you part of it, because the full resolution one is out of memory.
you could see the position of the image rotated 180 degree.
3,I generate the shannon entropy.

Then I want to put this images into snap. because this is one swath of the IW data. So I use split to extract the correlated Swath use the snap and do deburst or not deburst to the snap. and want to replace the metadata, but it always said dimension is not the same.




the non deburst one


the deburst one

but no one works.
Can you help to see what is the problem, Thank you!

Li

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.