Final topographic phase generation scripts

N.B. The original versions of most of the following scripts were written by David T. Sandwell for the Salton Sea region. These were adapted and appended by Karen Watson for use in the Los Angeles region.

This is the master-script which calls the other scripts.

You will need to edit the stack directory (/export/home/sar/kwatson/sar_proc/stack1) to the location of your stack... Note that for the second iteration, you will use a */stack2 directory, and edit clean_end_1st.com to clean_end_2nd.com incorporating that change. (And so on for successive iterations.)

#!/bin/csh
#KMW set /bin/csh for geodesy group
#
# clean bad ends
#
#KMW edited from DS' do_both_1st script
#
#KMW cd /raidsat/sandwell/intf_topo/23891_04218
cd /export/home/sar/kwatson/sar_proc/stack1
clean_end_1st.com
#
# stack and unwrap
#
stack_1st.com >& stack_1st.log
unwrap_topo_1st.com >& unwrap_topo_1st.log

This is the clean_end_1st.com script. It is *very* basic and simply calls the clean_end script (see below) to remove the erroneous lines from the end of all the datasets used in creating the topographic phase...

You will need to edit the iteration directories (/export/home/sar/kwatson/sar_proc/*_*/itn1) to the locations of your iterations... Note that for the second iteration, you will use */itn2 directories, and will have to edit stack_1st.com to stack_2nd.com incorporating that change. (And so on for successive iterations.)

#!/bin/csh
cd /export/home/sar/kwatson/sar_proc/02529_22202/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/03531_23204/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/05535_25208/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/11547_11046/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/11838_11337/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/13050_13551/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/14553_14052/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/23571_24072/itn1
clean_end
cd /export/home/sar/kwatson/sar_proc/23705_04032/itn1
clean_end

The clean_end script...

#!/bin/csh
#
mv xphase_clean.gips xphase_clean.gips.old
mv yphase_clean.gips yphase_clean.gips.old
#
echo " cleaning end of image "
iha "p = (y > 6420.) ? 4. : p1;" xphase_clean.gips.old > xphase_clean.gips
iha "p = (y > 6420.) ? 4. : p1;" yphase_clean.gips.old > yphase_clean.gips
#

Return to the top (master-script).

This is the stack_1st.com script. It is also *very* basic and simply calls the executables stack_topo and normalize_topo to stack the x- and y-phases and normalise by the cumulative baseline length.

You will again need to edit the iteration directories (/export/home/sar/kwatson/sar_proc/*_*/itn1) to the locations of your iterations... Note that for the second iteration, you will use */itn2 directories, and will have to edit stack_1st.com to stack_2nd.com incorporating that change. (And so on for successive iterations.)

#!/bin/csh
stack_topo /export/home/sar/kwatson/sar_proc/02529_22202/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/03531_23204/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/05535_25208/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/11547_11046/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/11838_11337/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/13050_13551/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/14553_14052/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/23571_24072/itn1 1.
stack_topo /export/home/sar/kwatson/sar_proc/23705_04032/itn1 1.
#
normalize_topo 80.

Return to the top (master-script).

This is the unwrap_topo_1st.com script.

With each successive iteration you will need to edit filenames. E.g. for iteration two, change:
  tot_phase_1.gips => tot_phase_2.gips
  dem_phase_0.gips => tot_phase_1.gips
  all_topo_1.gips => all_topo_2.gips
For the second and successive iterations you will also need to change the following:
  4 km => 6 km and, more importantly, unwrap stackx.gips stacky.gips 4. x_tot_phase.gips y_tot_phase.gips => unwrap stackx.gips stacky.gips 6. x_tot_phase.gips y_tot_phase.gips
  set iter = 10 => set iter = 12
  iha "p = (p1 == 4. || p3 < 1.5) ? p2 : p1" \ => iha "p = (p1 == 4. || p3 < 5.0) ? p2 : p1" \
  iha "p = (p1 == 4. || p3 < 1.5) ? p2 : p1" \ => iha "p = (p1 == 4. || p3 < 5.0) ? p2 : p1" \
  unwrap xnew.gips ynew.gips 6. tot_phase_1.gips => unwrap xnew.gips ynew.gips 8. tot_phase_2.gips
  unwrap xnew.gips ynew.gips 4. x_tot_phase.gips y_tot_phase.gips => unwrap xnew.gips ynew.gips 6. x_tot_phase.gips y_tot_phase.gips

#!/bin/csh
# KMW set /bin/csh for geodesy group
#
# script to unwrap total stacked phase
# iterate to fill holes
# suppress all long wavelengths
#
# KMW edited from DS' unwrap_topo_1st.com script
#
# smooth the cumulative sum
# KMW edit filter directory
ihconv 1 1 /opt/siosar/filters/gauss5x3 < sumBx.gips > sumBx_flt.gips
ihconv 1 1 /opt/siosar/filters/gauss5x3 < sumBy.gips > sumBy_flt.gips
#
# now unwrap original don't include wavelengths > 4 km
#
unwrap stackx.gips stacky.gips 4. x_tot_phase.gips y_tot_phase.gips
#
# Iterate to fill holes and resolve residues
#
set iter = 10
#
while ($iter > 0)
echo $iter
echo $iter > junk
set iter = `cat junk | nawk '{print ($1 -1)}'`
#
# replace the original null values with the new estimates
# also don't use estimates where cumulative baseline < 1.0
# for this run the maximum cumulative baseline was about 3.
#
iha "p = (p1 == 4. || p3 < 1.5) ? p2 : p1" \
stackx.gips x_tot_phase.gips sumBx_flt.gips > xnew.gips
#
# next do y
#
iha "p = (p1 == 4. || p3 < 1.5) ? p2 : p1" \
stacky.gips y_tot_phase.gips sumBy_flt.gips > ynew.gips
#
# now unwrap_topo again with the nulls filled with reasonable values
# cut the long wavelengths
# get total phase if this is last iteration
#
if ($iter == 0) then
unwrap xnew.gips ynew.gips 6. tot_phase_1.gips
else
unwrap xnew.gips ynew.gips 4. x_tot_phase.gips y_tot_phase.gips
endif
#
# end iteration
#
echo "end iteration"
end
#
# add the long wavelength phase back
#
iha "p=p1+p2" tot_phase_1.gips dem_phase_0.gips > all_phase_1.gips
#
# convert phase to topo
#
phase2topo all_phase_1.gips all_topo_1.gips

Return to the top (master-script).

Back to: InSAR class homepage
Last modified: 4 October 2000