S1 L2 Product Issue

Dear Sen4Cap,

We have observed that S1 L2 product generated strange output as below screenshot even though our sample site is on Netherlands? Currently, we are running on V 1.1. Is it a bug of V 1.1? We better to upgrade V 1.2? Our concern is starting site from the scratch again.

S1L2 Output

Thanks and Regards,
Henry

Dear Henry,

Yes, that was an issue with the projected coordinates of the footprint for the quicklook (the actual product did not have any problem). This issue was addressed in v1.2, but I think that the footprint for these products has to be manually updated in the database, on a case-by-case basis. If you want to keep them, then I can send you some small instructions on how to do that (please write me at kraftek@c-s.ro).

Best regards,
Cosmin.

1 Like

Dear Cosmin,

Looking forward to trying out the instruction. I have sent email yesterday. sent by henryhein@gmail.com

Thanks and Regards,
Henry

Dear Henry,

I have sent you a script by email.
For reference, and if someone else would encounter the same problem, I am also uploading it here:
correct_s1_l2_footprints.txt (1.7 KB)
How to use it:

  1. Copy it in your home directory
  2. Rename it to correct_s1_l2_footprints.sh
  3. Make it executable
    chmod +x correct_s1_l2_footprints.sh
  4. Execute it as sudo:
    sudo ./correct_s1_l2_footprints.sh <site_folder>
    where <site_folder> is the path to your site (for example, /mnt/archive/myTestSite).

Cosmin.

1 Like

Dear Cosmin,

Thanks a lot for your support, as usual.

It’s worked after I changed a few parameters.

Here is what I did.

  1. I run these commands manually as I got some errors (couldn’t recall)

find l2a-s1/ -name β€˜_AMP.tif’ -print0 | while IFS= read -r -d β€˜β€™ line; do IFS=’/’ read -ra arr <<< $line; ( echo β€œUPDATE product SET geog = st_geogfromtext(TRIM(’”; echo β€˜POLYGON((’; gdalinfo -json "line" | jq -r '.wgs84Extent.coordinates[][]' | tr -s "[," " " | tr "]" "," | xargs | rev | cut -c 2- | rev; echo "))')) WHERE name = TRIM('"; echo {arr[2]} | rev | cut -c 5- | rev; echo β€œβ€™);”; echo β€œUPDATE product SET footprint = (SELECT β€˜(’ || string_agg(REPLACE(replace(ST_AsText(geom) :: text, β€˜POINT’, β€˜β€™), ’ β€˜, β€˜,’), β€˜,’) || β€˜)’ from ST_DumpPoints(ST_Envelope(geog :: geometry)) WHERE path[2] IN (1, 3)) :: POLYGON WHERE name = TRIM(’”; echo ${arr[2]} | rev | cut -c 5- | rev; echo β€œβ€™);” ) | cat | tr β€˜\r\n\t’ ’ ’ >> ~/sql_amp.txt; done;
find l2a-s1/ -name '
_COHE.tif’ -print0 | while IFS= read -r -d β€˜β€™ line; do IFS=’/’ read -ra arr <<< $line; ( echo β€œUPDATE product SET geog = st_geogfromtext(TRIM(’”; echo β€˜POLYGON((’; gdalinfo -json "line" | jq -r '.wgs84Extent.coordinates[][]' | tr -s "[," " " | tr "]" "," | xargs | rev | cut -c 2- | rev; echo "))')) WHERE name = TRIM('"; echo {arr[2]} | rev | cut -c 5- | rev; echo β€œβ€™);”; echo β€œUPDATE product SET footprint = (SELECT β€˜(’ || string_agg(REPLACE(replace(ST_AsText(geom) :: text, β€˜POINT’, β€˜β€™), ’ β€˜, β€˜,’), β€˜,’) || β€˜)’ from ST_DumpPoints(ST_Envelope(geog :: geometry)) WHERE path[2] IN (1, 3)) :: POLYGON WHERE name = TRIM(’”; echo ${arr[2]} | rev | cut -c 5- | rev; echo β€œβ€™);” ) | cat | tr β€˜\r\n\t’ ’ ’ >> sql_cohe.txt; done;

  1. I changed to sen2agri-service username as postgres user name is not allowed.

sudo psql -U sen2agri-service -d sen4cap -a -f sql_amp.txt
sudo psql -U sen2agri-service -d sen4cap -a -f sql_cohe.txt

Regards,
Henry

Dear Sen4Cap,
i do encounter the same Problem. For my understanding, it is not a problem with the S1 L2 products itself, but a problem with the projection in the presentation in the product tab?
Therefore calculating with the data is possible?

Thanks!

1 Like