Patches

Patches for bugs in the ROI_pac code.

Note: to process 3 or more ALOS frames, you need to manually edit the Maxwidth variable in add_rmg.c

Patches for ROI_pac version 3.0.1

intsim/IntSim.f

There was a bug in the code that meant the padding of the area of the DEM to be used was not correctly applied. This affected scenes at high elevation. To fix this add these lines after line 1341 in the IntSim.f file and rebuild the software:

diff IntSim.f IntSim.f~
1342,1348d1341
< ! update these after padding has been applied EJF 2013/5/9
<       nslatpx = int(dem_pixel_min(1))
<       nslonpx = int(dem_pixel_min(2))
<       nlatpx = nint(dem_pixel_max(1)) - nslatpx + 1
<       nlonpx = nint(dem_pixel_max(2)) - nslonpx + 1
< 
< 

INT_SCR/make_raw_alos.pl

The 3.0.1 release has an old version of make_raw_alos.pl in the ROI_PAC/INT_SCR directory that does not do the concatenation of frames. The old file also is not copied to the installs/share/roi_pac directory by the contrib/multibuild.sh script so you may get a "make_raw_alos.pl not found" message. You should download and install in your $INT_SCR directory the latest version of make_raw_alos.pl from the ALOS_PALSAR page on this wiki, especially if you want to concatenate PALSAR frames.

fip/add_rmgAmpPhs

The 3.0.1 release does not build and install the add_rmgAmpPhs program that is used in the new snaphu.pl script. You can compile it in the ROI_PAC/fip directory with gcc -o add_rmgAmpPhs add_rmgAmpPhs.c and then copy the executable to your $INT_BIN.

Patches for ROI_pac version 3.0

All of the patches below have been included in the version 3.0.1 release.

INT_SCR/baseline.pl

There was an error in the calculation of perpendicular and parallel components of the baseline from the horizontal and vertical components. This affected the  P_BASELINE_TOP|BOTTOM_$BaselineType  and  ORB_SLC_R_OFFSET_$BaselineType  metadata parameters in the  $date1_$date2_baseline.rsc  file. Belle Philibosian located and corrected this error, and tested it against other ALOS baseline calculation programs. Note that this does not affect the flattening of interferograms because that only uses the horizontal and vertical components that remain unchanged. Here is a difference between the patched version and the 3.0 release version.

Index: baseline.pl
===================================================================
retrieving revision 1.3
retrieving revision 1.4
diff -r1.3 -r1.4
148,150c148,154
<   $csb[$i]    = $hb[$i]*$cosl+$vb[$i]*$sinl;
<   $asb[$i]    = $hb[$i]*$sinl-$vb[$i]*$cosl;
<   
---
> #  Sign error correction (Belle Philibosian, 2/9/2008)
> #  These calculations still assume a right-looking beam; will not work for left-looking
> #  $csb[$i]    = $hb[$i]*$cosl+$vb[$i]*$sinl;
> #  $asb[$i]    = $hb[$i]*$sinl-$vb[$i]*$cosl;
>   $csb[$i]    = -1*$hb[$i]*$cosl+$vb[$i]*$sinl;
>   $asb[$i]    = -1*$hb[$i]*$sinl-$vb[$i]*$cosl;
>  
167,168c171,173
< #$r_offset  = ($r0-$r0_2-($asb_avg))/$range_pixel_size;
< $r_offset  = (($asb_avg)+($r0-$r0_2))/$range_pixel_size;
---
> $r_offset  = ($r0-$r0_2-($asb_avg))/$range_pixel_size;
> # changed this back to the previous formula EJF 2009/2/9
> #$r_offset  = (($asb_avg)+($r0-$r0_2))/$range_pixel_size;
590a596
> Frederic Crampe, Aug 26, 1999
594c600
< Frederic Crampe, Aug 26, 1999
---
> Belle Philibosian Feb. 9, 2009

contrib/install-fftw.sh

Not a bug, but an update. The FFTW version was changed (again) on the fftw.org website from 3.2 to 3.2.1 in February 2009. The ROI_pac v.3.0 was set to FFTW version 3.1.2. The install-fftw.sh script needs to be changed

<ver=3.1.2
>ver=3.2.1

simulation/Aik_resample.f

A bug in this program caused it to crash on some 64-bit computers and give NaN values on other computers. Here is a difference between the patched version and the 3.0 release version. Note: this is the opposite sense of difference from what was posted here earlier.

<Index: Aik_resample.f
===================================================================
retrieving revision 1.2
retrieving revision 1.4
diff -r1.2 -r1.4
144,149c144,149
<       ALLOCATE( r_surfh((i_skip+i_padn+1)*(i_skip+i_padn+1)))
<       ALLOCATE( r_surfa((i_skip+i_padn+1)*(i_skip+i_padn+1)))
<       ALLOCATE( r_bvx((i_skip+i_padn+1)*(i_skip+i_padn+1)))
<       ALLOCATE( r_bvy((i_skip+i_padn+1)*(i_skip+i_padn+1)))
<       ALLOCATE( r_bvz((i_skip+i_padn+1)*(i_skip+i_padn+1)))
<       ALLOCATE( r_bva((i_skip+i_padn+1)*(i_skip+i_padn+1)))
---
>       ALLOCATE( r_surfh((i_skip+2*i_padn)*(i_skip+2*i_padn)))
>       ALLOCATE( r_surfa((i_skip+2*i_padn)*(i_skip+2*i_padn)))
>       ALLOCATE( r_bvx((i_skip+2*i_padn)*(i_skip+2*i_padn)))
>       ALLOCATE( r_bvy((i_skip+2*i_padn)*(i_skip+2*i_padn)))
>       ALLOCATE( r_bvz((i_skip+2*i_padn)*(i_skip+2*i_padn)))
>       ALLOCATE( r_bva((i_skip+2*i_padn)*(i_skip+2*i_padn)))
270c270
<      $              nint(r_blockareac))) then
---
>      $              int(r_blockareac+0.5))) then

$INT_SCR/make_sim.pl

When processing very long strips (more than about 1200 km), often the IntSim program fails. This patch from MattPritchard seems to prevent that. This patch also has the opposite sense from the previous post.

Index: make_sim.pl
===================================================================
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -r1.1.1.1 -r1.2
94,95c94,96
< $utc0=$first_line_utc-300;
< $utc1=$first_line_utc+$length*$delta_line_utc+300;
---
> # increased padding of extracted orbit data per Matt Pritchard
> $utc0=$first_line_utc-400;
> $utc1=$first_line_utc+$length*$delta_line_utc+400;

Patches (last edited 2013-05-16 14:14:09 by adsl-99-146-17-124)