geodesymiami / rsmas_insar

RSMAS InSAR code
https://rsmas-insar.readthedocs.io/
GNU General Public License v3.0
62 stars 23 forks source link

Does run_10_filter_coherence really require coreg_secondarys/*/*/burst_01.slc.vrt files? #462

Open falkamelung opened 3 years ago

falkamelung commented 3 years ago

TheWe implemented copy-to-local-disk of '/merged/SLC/20160605' dir for run_10_filter_coherence step because the merged SLCs are used to create the complex coherence fine.cor:

cat config_igram_filt_coh_20160605_20160629
[Common]
##########################
###################################
[Function-1]
FilterAndCoherence : 
input : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/interferograms/20160605_20160629/fine.int
filt : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/interferograms/20160605_20160629/filt_fine.int
coh : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/interferograms/20160605_20160629/filt_fine.cor
strength : 0.2
slc1 : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/SLC/20160605/20160605.slc.full
slc2 : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/SLC/20160629/20160629.slc.full
complex_coh : /scratch/05861/tg851601/unittestGalapagosSenDT128/merged/interferograms/20160605_20160629/fine.cor
range_looks : 15
azimuth_looks : 5

However, we got the error

/tmp/20160605/20160605.slc.full.vrt
ERROR 4: /tmp/20160605/../../../reference/IW1/burst_01.slc.vrt

It turns out that FilterAndCoherence wants to open several vrt files because of relativetoVRT strings in the vrt files.

grep relative /tmp/20160605/20160605.slc.full.vrt
            <SourceFilename relativeToVRT="1">../../../reference/IW1/burst_01.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../reference/IW1/burst_02.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../reference/IW1/burst_03.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../reference/IW1/burst_04.slc.vrt</SourceFilename>
 grep rela ./20160711.slc.full.vrt
            <SourceFilename relativeToVRT="1">../../../coreg_secondarys/20160711/IW1/burst_01.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../coreg_secondarys/20160711/IW1/burst_02.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../coreg_secondarys/20160711/IW1/burst_03.slc.vrt</SourceFilename>
            <SourceFilename relativeToVRT="1">../../../coreg_secondarys/20160711/IW1/burst_04.slc.vrt</SourceFilename>

The first issue is solved by copy-to-local-disk of /reference but we could not resolve the second issue with the current version of distribute.bash. It does not allow to specify the destination directory (it copies coreg_secondarys/20160711 to /tmp/20160711 but we need it in coreg_secondarys/20160711 ). We therefore removed copy-to-local-disc of merged/SLC using https://github.com/geodesymiami/rsmas_insar/commit/ba5b09c9d879b6eedf387399b9ad608acb99900b

I don't think the burst_01.slc.vrt is really required. Can ISCE be modified so that unnecessary *vrt files are not opened? It happens in computeCoherence.

Here a description of the limitation ofdistribute.bash: distribute.bash coreg_secondarys/20160711 results in /tmp/20160711 on the node. distribute.bash coreg_secondarys results in /tmp/coreg_secondarys but it would copy all directories in /coreg_secondarys, including those we don't need for this job/node, so this is not an option. We would distribute.bash to accept the destination directory: distribute.bash coreg_secondarys/20160711 coreg_secondarys to result in /tmp/coreg_secondarys/20160711

I see two alternatives:

  1. we first copy the relevant files into /scratch/coreg_secondarys_jobid, use distribute.bash for copying to /tmp and rename to /tmp/coreg_secondarys.
  2. As we use only one node we could use cp instead of distribute.bash

I

mirzaees commented 3 years ago

This is what I was looking at to find a solution last week, seems like it is from c code, I could not find the source. somewhere it uses the address in merged/slc//.vrt to find the corresponding bursts before merging and by default it searches based on isce folders arrangement, it goes to ../../../ to find coreg_secondarys and reference folder. I don't know where is this happening, we should ask ISCE team

falkamelung commented 3 years ago

The function that fails is /TopsProc/runBurstIfg.py. After copying /reference to /tmp it fails in slc2.createImage() and, more precisely, it fails in DataAccessor/DataAccessorPy.py.

I get the message

GDAL open (R): /tmp/merged/SLC/20160629/20160629.slc.full.vrt
ERROR 4: /tmp/merged/SLC/20160629/../../../coreg_secondarys/20160629/IW1/burst_01.slc.vrt: No such file or directory
Error. Cannot open the file /tmp/merged/SLC/20160629/20160629.slc.full.vrt in read mode.
Error in file /home/conda/feedstock_root/build_artifacts/isce2_1605839897087/work/build/components/iscesys/ImageApi/InterleavedAccessor/src/GDALAccessor.cpp at line 77 Exiting

The question is why does it want to open coreg_secondarys/20160629/IW1/burst_01.slc.vrt? It is listed in /tmp/merged/SLC/20160629/20160629.slc.full.vrt.
I tried just copying burst_01.slc.vrt to /tmp but it insisted on a full-size burst_01.slc.