GIANT tutorial

391 views
Skip to first unread message

buend...@hotmail.com

unread,
Jan 20, 2014, 7:14:16 AM1/20/14
to adore...@googlegroups.com

First of all I have to apologise since I did not want to post thus thread in the ADORE-DORIS forum but in fact I tried to post the issue into the GIANT -user forum but I could not find the way to do that even if I was logged in.

 

I have a ubuntu distribution 12.04 and I was able to built up all the dependencies via puppet script and to set the relative path correctly.

I also imported the folder PyAPS in to the GIANT folder and set the path for PyASP.

I went through the tutorial (synthetic) without problems and I was able to visualise the SBAS results throughout the plotts.py and to the inversion.

But when I tried to geocode the results using the rdr5geo.py script and I had the following error message:

vecfil@ING-VECFIL-1109:~/synthetic$ python -i rdr2geo.py

Traceback (most recent call last):

  File "rdr2geo.py", line 13, in <module>

    lats = np.fromfile(latfile,dtype=np.float32).reshape((ln,wd))

IOError: [Errno 2] No such file or directory: 'lat.flt'

 

So I read the thread on the GIANT community forum and I now know that I need to set lat and long since the beginning on the prepxml.py which are setted to null ('').

Then I tried my self but I faced thje following error:

vecfil@ING-VECFIL-1109:~/SAR/synthetic$ python -i PrepIgramStack.py

logger - INFO - GIANT Toolbox - v 1.0

logger - INFO - ---------------------

/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py:2: UserWarning: Module dap was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path

  __import__('pkg_resources').declare_namespace(__name__)

<module> - INFO - Number of interferograms = 263

<module> - INFO - Number of unique SAR scenes = 85

<module> - INFO - Number of connected components in network: 6

<module> - WARNING - The network appears to be contain disconnected components

<module> - INFO - No common mask defined

<module> - INFO - Output h5file: Stack/RAW-STACK.h5

<module> - INFO - PNG preview dir: Figs/Igrams

<module> - INFO - Reading in IFGs

[============================================================]    159s /      1s

<module> - INFO - Fixing mask and geometry files.

Traceback (most recent call last):

  File "PrepIgramStack.py", line 322, in <module>

    conv = (chgendian and 'LAT' in endianlist))

  File "/opt/giant/GIAnT/tsinsar/tsio.py", line 126, in load_mmap

    raise Exception('Could not open BSQ style file or file of wrong size: ' + fname)

Exception: Could not open BSQ style file or file of wrong size: lat

 

 

 

My first question is how do I set the lat long correctly on the prepxml.py for the tutorial probably by using the file lat.flt and lon.flt contained on the PyAPS folder but I should also add the endianlist=['LAT','LON'] in the prepxml.py? And what I should insert in the blank latfile and lonfile?

The second question concern instead the use of the dem or hgt.rsc file very important for the atmosferic correction.

Again in the prepxml.py what should I add to the hgtfile=''?

I'm sure I can use the hgt.rsc file included in the pyaps folder as well.

Best regards

Batuhan Osmanoglu

unread,
Jan 22, 2014, 10:21:37 AM1/22/14
to buend...@hotmail.com, adore...@googlegroups.com
Hi Flippo, 

I am not as well-versed in GIANT as Piyush so not sure if what I suggest will work. 

So I see that you are trying to use rdr2geo.py to convert your results into geodetic coordinates. Assuming you generated your results with ADORE-DORIS, why wouldn't you use the "geocode" step in Doris? If you do that, you can than use that to geocode your GIANT results... Please let me know if you would need further assistance on how to do that. 

Your other question is about the lat.flt and lon.flt files. I never created those myself when I was processing things with GIANT. if you supply a DEM and with the right RSC file (see my comments to your previous email) GIANT will generate those files for you based on the RSC settings. HGT file will also come from that. 

If you are using GIANT in conjunction with ADORE DORIS I suggest you take a look at the "giant" command in adore:

The "giant prepxml_SBAS" command will add the right parameter for hgt file if you have the "$crd_out_dem_lp" generated. 

Hope this clarifies things a little, 
best,
batu.

--
Batuhan Osmanoglu, Ph.D.
Partner
BOS Technologies, LLC


--
You received this message because you are subscribed to the Google Groups "ADORE-DORIS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adore-doris...@googlegroups.com.
To post to this group, send email to adore...@googlegroups.com.
Visit this group at http://groups.google.com/group/adore-doris.
For more options, visit https://groups.google.com/groups/opt_out.

buend...@hotmail.com

unread,
Mar 25, 2014, 10:21:56 AM3/25/14
to adore...@googlegroups.com

Hello dear Batu,

finally thanks to the last post posted by Katherina I managed (in one pc with Ubuntu 13.04) to obtain from the adr script MultiplePairs a first grasp of a SBAS interferometry.

At first I used the multiplepairs.adr script and I managed to create a series of unwrapped, filtered and dem corrected interferograms.

Then I applied as on the last document sent by Katerina the further steps in doris with giant:

Giant prepxml_SBAS, giant prepIgramStack, giant process stack, giant SBAS invert and finally Python plots.py.

I was able to see interactively the time series and the final SBAS product correctly.

Then I tried to export the result in kml using python make_kml.py but I could not obtain the kml since I needed the lat.flt and lon.flt.

So I remember your suggestion to process the interferograms further and perform a geocode in adore-doris;

I added two extra bits on the interferoSteps:”slant2htrick;geocode” in multiplepairs.adr script.

And I launched again the script (after previously having  deleted the data.xml and sbas.xml and the folders created by giant) and it seemed to have worked, then I did again the giant steps but when I used the kml export tool I had the same mistake.

Is there another way to geocode and export the final SBAS product to be able to be viewed into a GIS  software ?

Another question instead is connected to the use of pyaps, when I tried to perform a python testpyps.py I had error n2 file or folder not found.

Is there any mistake in the way  I added the full path to the pyaps directory intop my .bashrc file?

export PYAPS=/opt/giant/GIAnT/pyaps

export PYTHONPATH=$PYAPS:$PYTHONPATH

Best regards

Filippo

Batuhan Osmanoglu

unread,
Mar 26, 2014, 7:25:56 AM3/26/14
to buend...@hotmail.com, adore...@googlegroups.com

Dear Flippo,

To geocode results, you can use the saveas command to use the Doris geocoding and generate a GIS compatible file. Alternatively you can use the latitude and longitude files and load them as point cloud locations... depending on your setup it might include too many points and crash your GIS software, just so you know.

About the Pyaps error. Could you please send the complete error message in terminal? Nothing comes to mind right away.

Best,
Batu

--
You received this message because you are subscribed to the Google Groups "ADORE-DORIS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adore-doris...@googlegroups.com.
To post to this group, send email to adore...@googlegroups.com.
Visit this group at http://groups.google.com/group/adore-doris.
For more options, visit https://groups.google.com/d/optout.

buend...@hotmail.com

unread,
Mar 26, 2014, 8:05:06 AM3/26/14
to adore...@googlegroups.com
Dear Batu,
many thanks for your quick reply.
If I do as you suggested by using the saveas command I get only the three differencial interferograms of adore-doris but what I´d rather want is the result of the SBAS analysis from Giant. How do I ceate the lat.flt and lon.flt?
an for the second question that´s what I get from the terminal when I tried the pyaps:

!ADORE: python TestPyAPS.py

python: can't open file 'TestPyAPS.py': [Errno 2] No such file or directory

!ADORE:

thanks again for your very precious cooperation.
Regards

Flippo




On Monday, 20 January 2014 13:14:16 UTC+1, buend...@hotmail.com wrote:

Batuhan Osmanoglu

unread,
Mar 26, 2014, 2:01:40 PM3/26/14
to buend...@hotmail.com, adore...@googlegroups.com

Hi Filippo,

if I remember correctly you can pass an alternate binary file to saveas using the colon (:) operator. See the wiki page for raster as an example:
https://code.google.com/p/adore-doris/wiki/raster

I guess I forgot to add those to saveas wiki page. If the format of giant file is different from the one one in the doris step (ex. cr4 vs r4 etc) you will also need to use the -f option. If it does not work it is a bug, please report it in Google Code.

The pyaps error indicates the file can not be found. You can always give the full path to the file starting with /

Best,
Batu.

--

buend...@hotmail.com

unread,
Apr 3, 2014, 5:03:45 AM4/3/14
to adore...@googlegroups.com, buend...@hotmail.com
Dear Batu,
I finally solve the issue with the atmospheric correction, as you said the extra / is required and finally after registration and variable settings:

export PYAPS=/opt/giant/GIAnT/pyaps

export PYTHONPATH=$PYAPS:$PYTHONPATH

I could retrieve the pressure files from the ECMWF server and make a step forward in the processing.

Instead concerning the geocoding procedure of unwrap interferograms in adore before launching prepigramstack.py I think I did not get it right since my results (see attachments only with 3 interferograms) are still shown in radar coordinates.

what is the correct procedure after the script multiple pairs, to have my unwrapped interferograms geocoded in adore-doris?

Still I have trouble on using for instance make_kml.py since it end up with this error:


filippo@filippo-Aspire-5742G:~/GIS/sbas2/process/loc1/giant$ python make_kml.py -i Stack/LS-PARAMS.h5 -x data.xml

logger - INFO - GIANT Toolbox - v 1.0

logger - INFO - ---------------------

/usr/lib/pymodules/python2.7/mpl_toolkits/__init__.py:2: UserWarning: Module dap was already imported from None, but /usr/lib/python2.7/dist-packages is being added to sys.path

__import__('pkg_resources').declare_namespace(__name__)

Traceback (most recent call last):

File "make_kml.py", line 71, in <module>

latf = os.path.join(h5dir,(pars.data.subimage.latfile))

File "/usr/lib/python2.7/posixpath.py", line 75, in join

if b.startswith('/'):

AttributeError: 'NoneType' object has no attribute 'startswith'

filippo@filippo-Aspire-5742G:~/GIS/sbas2/process/loc1/giant$


I guess this error is still connected to the lack of lat.flt and lon.flt files.
It is really hard for me to figure out how to get those two files.
I tried on changing the data.xml file in order to incorporate those two files without success and I was able to perform correctly dem load and dem export giant in giant.
finally I also tried as you suggested to convert the giant result file *.h5 in arcgis file without success:

ADORE: saveas arcgis p :LS-PARAMS.h5
bash: [: 5.449159: integer expression expected
bash: [: 5.449159: integer expression expected
bash: [: 5.449159: integer expression expected
I couldn't find that step in the resultfiles. Please check your master and slave settings are correct.
..width....
..format....
Reading geocoding information from: /home/filippo/GIS/sbas2/process/loc1/i12s/20030801_20040716/20030801_20040716.res
You requested me to generate: phase
No data file for the step :LS-PARAMS.h5 in

Could it be better maybe about this lat.flt and lon.flt ask on the giant forum directly?
Only one thing, even though I have registered on the giant forum I am not able to post any question there do you know how does it work there?
best regards

Filippo
cumulative_displacement.png

buend...@hotmail.com

unread,
May 6, 2014, 7:12:40 AM5/6/14
to adore...@googlegroups.com
hello everybody,
finally I managed to obtain a (restrained) SBAS deformation map geocoded!
1. I added “slant2h;geocode” to interferoSteps in the program multiplePairs.adr, your unwrapped interferogramms will be geocoded (in each folder i12s/maser-slave you will be able to see master-slave.geolam and master-slave.geophi files).
2. I am going to be able to see the files lon.flt and lat.flt in giant/Stack folder by adding some information in the file data.xml
 
<data>
...
  <master>
...
    <latfile>
      <value>path_to_i12s/master_slave.geophi</value>
      <type>STR</type>
      <help>Latitude file. Same size as IFGs.</help>
    </latfile>
    <lonfile>
      <value>path_to_i12s/master_slave.geolam</value>
      <type>STR</type>
      <help>Longitude file. Same size as IFGs.</help>
    </lonfile>
    <hgtfile>
      <value>path_to_i12s/master_slave.crddemlp</value>
      <type>STR</type>
      <help>DEM height in radar coordinates. Same size as IFGs.</help>
    </hgtfile>
...
  </master>
  <subimage>
...
    <latfile>
      <value>lat.flt</value>
      <type>STR</type>
      <help>Latitude file for the cropped and multilooked image.</help>
    </latfile>
    <lonfile>
      <value>lon.flt</value>
      <type>STR</type>
      <help>Longitude file for the cropped and multilooked image.</help>
    </lonfile>
...
  </subimage>
...
</data>
 
3. Then by running the following code from the giant directory:

python rdr2geo.py Stack/LS-PARAMS.h5 the file recons.flt and recons.grd will be created.

4. you can play around with the setting as you liking and then by using gmt with the command line grd2xyz recons.grd < recons.xyz you will be able to import this file in arcgis.

I really want to thank Elena and Piyush for the help.

best regards

Filippo




On Monday, 20 January 2014 13:14:16 UTC+1, buend...@hotmail.com wrote:

Batuhan Osmanoglu

unread,
May 6, 2014, 9:46:14 AM5/6/14
to buend...@hotmail.com, adore...@googlegroups.com
Congratulations Flippo, 

Thanks for letting us know. 

best, 
batu. 

--
Batuhan Osmanoglu, Ph.D.
Partner
BOS Technologies, LLC


--
You received this message because you are subscribed to the Google Groups "ADORE-DORIS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adore-doris...@googlegroups.com.
To post to this group, send email to adore...@googlegroups.com.
Visit this group at http://groups.google.com/group/adore-doris.

唐伟

unread,
Sep 15, 2014, 8:27:48 AM9/15/14
to adore...@googlegroups.com
Hi Flippo,
     I want to processed SBAS method in GIAnT with the input from adore-doris.I can not the command  'giant'  was not found in ADORE.What is the problem?
And GIAnT need a DEM and DEM.rsc file.How could I get these two files?
Thank you!
 在 2014年1月20日星期一UTC+8下午8时14分16秒,buend...@hotmail.com写道:

buend...@hotmail.com

unread,
Sep 28, 2014, 3:54:15 PM9/28/14
to adore...@googlegroups.com
Dear user,
if you have processed the various steps with ADORE in order to obtain your unwrapped interferograms and you were able to use the command p multiplePairs.adr correctly
(for an exhaustive description on how to use this command for GIANT see the link on http://www.osmanoglu.org/adore-doris-downloads GIANT with ADORE-DORIS by Katherine) you should launch the commands GIANT (look at the wiki web page https://code.google.com/p/adore-doris/wiki/sidebar?tm=6 "giant commands") directly from one of your i12s folder,and only from one of them otherwise the command will fail.
Concerning the other issue you can use the command dem export giant and this command will create the master_slave.rsc file.
I hope this suggestions will help you.
regards

Filippo
Reply all
Reply to author
Forward
0 new messages