Project

General

Profile

Prevent S1_coreg_TOPS failure when running on single bursts

Added by Julia Neelmeijer almost 6 years ago

Dear Charles,

when running S1_coreg_TOPS (and also S1_coreg_TOPS_dual_pol) I run into the following error:

...
...
...

*** Update keyword:value in text parameter files ***
*** Copyright 2006, Gamma Remote Sensing, v1.4 20-Nov-2006 clw ***

keyword found: range_offset_polynomial
current value: 0.00000    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00
new value:  -0.000228   0.0000e+00   0.0000e+00   0.0000e+00   0.0000e+00   0.0000e+00

*** Update keyword:value in text parameter files ***
*** Copyright 2006, Gamma Remote Sensing, v1.4 20-Nov-2006 clw ***

keyword found: azimuth_offset_polynomial
current value: 0.00000    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00
new value:  -0.000420   0.0000e+00   0.0000e+00   0.0000e+00   0.0000e+00   0.0000e+00
*** Geocoding lookup table refinement using DIFF_par offset polynomials ***
*** Copyright 2011, Gamma Remote Sensing, v2.1 8-Apr-2011 clw/uw ***

NOTE: simulated SAR image is reference
input lookup table width:    5345

range offset polynomial:   a0 + a1*r + a2*az+ a3*r*az + a4*r*r + a5*az*az
range offset polynomial coeff.:       -0.0002    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00

azimuth offset polynomial: b0 + b1*r + b2*az+ b3*r*az + b4*r*r + b5*az*az
azimuth offset polynomial coeff.:     -0.0004    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00    0.0000e+00

input lookup table width: 5345  lines: 1512

processing line:   1000
user time (s):         0.030
system time (s):       0.090
elapsed time (s):      0.140

S1_poly_overlap SLC_20170719_vv_tab 5 1 20170719_vv.az_ovr.poly 1
S1_poly_overlap: Script to determine polygons for overlap regions in Sentinel-1 TOPS data v1.3 28-Nov-2016 uw

generate polygons for azimuth overlaps
SLC_20170719_vv_tab nrows: 1   ncols: 3
RSLC1_IW1: /misc/ra11/neel/crop_lodging/2017_demmin_s1_p146/05_cslc/slc_20170719/20170719_vv_iw2.slc /misc/ra11/neel/crop_lodging/2017_demmin_s1_p146/05_cslc/slc_20170719/20170719_vv_iw2.slc.par /misc/ra11/neel/crop_lodging/2017_demmin_s1_p146/05_cslc/slc_20170719/20170719_vv_iw2.slc.tops_par
azimuth_line_time: 2.0555563e-03
range_pixel_spacing: 2.329562
start_time: 60755.6840410
IW1_valid_lines 26 to 1487  IW1_valid_samples: 263 to 5133
awk: cmd. line:1: (FILENAME=- FNR=1) fatal: division by zero attempted

ERROR: cannot open polygon vertices file: 20170719_vv.az_ovr.poly

I strongly assume that the reason for this is that I run this only on a Sentinel-1 single burst time-series (no overlapping areas) and that thus I should actually not use S1_coreg_TOPS, but rather SLC_coreg. Could this be?

Would it be possible to implement an option in S1_coreg_TOPS and S1_coreg_TOPS_dual_pol that automatically checks for this case and thus adapts the coregistration procedure? I am running an automated batch scripts on very different applications, sometimes with areas covering many bursts, sometimes only a single burst. I do not want to adapt my scripts every time I use only single burst data, especially since then I would also need to take care of the dual pol issue. It would be really nice if S1_coreg_TOPS and S1_coreg_TOPS_dual_pol could do this for me, thank you very much.

Best,
Julia


Replies (2)

RE: Prevent S1_coreg_TOPS failure when running on single bursts - Added by Julia Neelmeijer almost 6 years ago

Some comments on my progress in this issue:

Charles suggested (per mail) to use the following function to solve that issue:

S1_coreg_TOPS_no_refinement

However, I am not happy with this solution, as this will only do a coregistration based on the orbit data and DEM information. But what I want is the functionality of a coregistration like in SLC_coreg, where coregistration is performed first with offset_pwrm, offset_fitm and than refining with offset_pwr and offset_fit.

Now I tried to script this myself by considering the BURST_TAB file, here I tested whether there is only one line and if so, if the two values are the same (this indicates single burst selection). For bash this can look as follows:

    # check if only one burst is used (needs different coregistration function)
    local nblines=$(grep -c '' $burstfile) #determine number of lines (one burst is only true, if there is only one line for one swath)
    if [ $nblines -eq 1 ]; then
        # check if burst numbers are the same
        read burstnr1 burstnr2 < $burstfile
        if [ $burstnr1 -eq $burstnr2 ]; then
            echo "One burst only" 
            local oneburst_var=1    # one burst
        else
            local oneburst_var=0    # multiple bursts
        fi
    fi

Now if oneburst=1, I continued by applying for a single polarization case:

SLC_coreg
phase_sim_orb
SLC_diff_intf
multi_look

and if I have a second polarization I used the look-up table from the first run (first polarization) and applied to the data of the second polarization the following functions:

SLC_interp_lt
phase_sim_orb
SLC_diff_intf
multi_look

Now this worked all good, but in the next step, I would like to apply deramping (I wonder if that is actually necessary for single burst data)?
And I can't do that, since I am lacking a resampled/coregistered TOPS_par file. Now I am bit stuck.

Charles, I tried a lot to solve this issue by myself, but it is still not very convenient. So I would like to repeat my request: please alter S1_coreg_TOPS in such a way that it also performes a good coregistration on single burst data. Wouldn't it be just possible to use a test like above and if that is true, perform the spectral diversity method not on the overlapping polygons, but rather on the entire scene instead? I would therefore also have the ability to still define my own coregistration polygons, something that is still missing in my attempt above.

Thank you very much,
Julia

RE: Prevent S1_coreg_TOPS failure when running on single bursts - Added by Julia Neelmeijer almost 6 years ago

Ok, here a very simple way to temporarily overcome the above problem:
simply create a renamed copy of S1_coreg_TOPS (e.g. S1_coreg_TOPS_single_burst) and comment out the following two blocks

#########################################################################################
#########################################################################################
#########################################################################################

# Iterative improvement of azimuth refinement using spectral diversity method   
# Remark: here only a the burst overlap regions within the indicated polygon
# area poly2 are considered

# determine mask for polygon region poly2 that is at the same
# time part of the burst overlap regions

# if (1) then
#   if (-e "$SLC1_ID.az_ovr.poly") then
#     /bin/rm $SLC1_ID.az_ovr.poly
#   endif
#   if (`which poly_math | cut -c 1` != "/") then # poly_math program (LAT) not available
#     ln -s $MLI.lt $MLI.lt.az_ovr    # use entire area  
#   else
#     echo "S1_poly_overlap $SLC1_tab $RLK $AZLK $SLC1_ID.az_ovr.poly 1" 
#     S1_poly_overlap $SLC1_tab $RLK $AZLK $SLC1_ID.az_ovr.poly 1
#     poly_math $REF_MLI $REF_MLI.az_ovr $REF_MLI_width $SLC1_ID.az_ovr.poly - 1 0.0 1.0
#     raspwr $REF_MLI.az_ovr $REF_MLI_width 1 0 1 1 1.0 0.35 1 $REF_MLI.az_ovr.$ras 
#     # xv $REF_MLI.az_ovr.$ras &
#     # mask the lookup table
#     mask_class $REF_MLI.az_ovr.$ras $MLI.lt $MLI.lt.az_ovr 1 1 1 1 0 0.0 0.0
#   endif
# endif
# 
# # further reduce lookup table coverage to area specified by polygon poly2
# if (1) then
#   if ( -e "$poly2" ) then
#     if (`which poly_math | cut -c 1` != "/") then # poly_math program (LAT) not available
#       ln -s $MLI.lt $MLI.lt.az_ovr      
#     else
#       poly_math $REF_MLI.az_ovr $REF_MLI.az_ovr2 $REF_MLI_width $poly2 - 1 0.0 1.0
#       raspwr $REF_MLI.az_ovr2 $REF_MLI_width 1 0 1 1 1.0 0.35 1 $REF_MLI.az_ovr2.$ras 
#       # xv $REF_MLI.az_ovr2.$ras &
# 
#       # mask the lookup table
#       mask_class $REF_MLI.az_ovr2.$ras $MLI.lt $MLI.lt.az_ovr 1 1 1 1 0 0.0 0.0
#     endif
#   endif
# endif

#########################################################################################

# echo "" >> $p.coreg_quality
# echo "Iterative improvement of refinement offset azimuth overlap regions:" >> $p.coreg_quality
# 
# set daz10000 = "10000" 
# set it = "0" 
# while ( (( "$daz10000" > "5" ) || ( "$daz10000" < "-5" )) && ( "$it" < "$itmax" ) )     # iterate while azimuth correction >= 0.0005 SLC pixel
# 
#   # increase iteration counter
#   set it = `echo "$it" | awk '{printf "%d", $1+1}'`
#   echo "offset refinement using spectral diversity in azimuth overlap region iteration $it" 
#   
#   /bin/cp $off $off.start
# 
#   echo "SLC_interp_lt_ScanSAR $SLC2_tab $SLC_par $SLC1_tab $REF_SLC_par $MLI.lt.az_ovr $REF_MLI_par $MLI_par $off.start $RSLC2_tab $RSLC $RSLC_par" 
#   SLC_interp_lt_ScanSAR $SLC2_tab $SLC_par $SLC1_tab $REF_SLC_par $MLI.lt.az_ovr $REF_MLI_par $MLI_par $off.start $RSLC2_tab $RSLC $RSLC_par > SLC_interp_lt_ScanSAR.2.out
# 
# if ( ($#argv >= 16) && (-e "$16" ) ) then 
#   echo "S1_coreg_overlap $SLC1_tab $RSLC2_tab $p $off.start $off $cc_thresh $fraction_thresh $stdev_thresh $cleaning $RSLC3_tab > $off.az_ovr.$it.out" 
#   S1_coreg_overlap $SLC1_tab $RSLC2_tab $p $off.start $off $cc_thresh $fraction_thresh $stdev_thresh $cleaning $RSLC3_tab > $off.az_ovr.$it.out
# else
#   echo "S1_coreg_overlap $SLC1_tab $RSLC2_tab $p $off.start $off $cc_thresh $fraction_thresh $stdev_thresh $cleaning > $off.az_ovr.$it.out" 
#   S1_coreg_overlap $SLC1_tab $RSLC2_tab $p $off.start $off $cc_thresh $fraction_thresh $stdev_thresh  $cleaning > $off.az_ovr.$it.out
# endif
# 
#   set daz = `awk '$1 == "azimuth_pixel_offset" {print $2}' $off.az_ovr.$it.out`      
#   set daz10000 = `awk '$1 == "azimuth_pixel_offset" {printf "%d", $2*10000}' $off.az_ovr.$it.out`      
#   echo "daz10000: $daz10000" 
#   /bin/cp $off $off.az_ovr.$it
# 
#   echo "az_ovr_iteration_""$it"": $daz (daz in SLC pixel)" >> $p.coreg_quality
#   more $p.results >>  $p.coreg_quality
#   echo "" >> $p.coreg_quality
# 
# end

#########################################################################################
#########################################################################################
#########################################################################################

That's it.

Since this is not official, I still like to see this implemented, ideally within S1_coreg_TOPS and S1_coreg_dual_pol with an automatic detection whether the above block should be run or not.
E.g. one could just check whether the overlapping polygon is empty and if so, skip the block.
Thanks!

    (1-2/2)