<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><a name="_GoBack"></a><span lang="EN-US">Hello,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I am using GDAL through OTB (the Orfeo Toolbox) to process TSX/TDX products with the specific driver: COSAR/COSAR Annotated Binary Matrix (TerraSAR-X).<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">With TSX products, the driver works fine.
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">I have also tried to read CoSAR files from TDX products. Data have a huge difference with a floating point data format instead of integer values. This floating format is
 a specific format called "Half Precision Floating Point" for each of the complex values. Thus, TDX products are not well-interpreted. Further information are available in TD-GS-PS-3028_TanDEM-X-Experimental-Product-Description_1.2. The annotations seem to
 be the same than TSX products. <o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">I need your help to include this new format in GDAL and so in OTB.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">As far as I can understand, the specific driver for CoSAR binaries is implemented in
<a href="https://github.com/OSGeo/gdal/blob/master/gdal/frmts/cosar/cosar_dataset.cpp" target="_blank">
https://github.com/OSGeo/gdal/blob/master/gdal/frmts/cosar/cosar_dataset.cpp</a>. The data type is set to GDT_CInt16. I think that explains why TDX are not well-interpreted. In my opinion, in order to include TDX products a conversion has to be made before
 assigning the buffer. I have found an algorithm to convert “half float” to single float :
<a href="http://blog.schmorp.de/data/binary16/fasthalffloatconversion.pdf">http://blog.schmorp.de/data/binary16/fasthalffloatconversion.pdf</a>      
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">Do you think, is it possible to implement this feature in GDAL?<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">Regards,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-align:justify;text-autospace:none"><span lang="EN-US">Gaëlle.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#DEEAF6;mso-fareast-language:FR">--------------------------------------------------------------------------------------------------------------<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="color:#1F4E79;mso-fareast-language:FR">Gaëlle Usseglio</span></b><span style="color:#1F4E79;mso-fareast-language:FR"> -</span><i><span style="color:#5B9BD5;mso-fareast-language:FR">Thales Services</span></i><span style="color:#5B9BD5;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#5B9BD5;mso-fareast-language:FR">Responsable de prestation :
</span><span style="color:#1F4E79;mso-fareast-language:FR">Support HPC</span><span style="color:#5B9BD5;mso-fareast-language:FR"> (Portages, Optimisations, Audits, Expertises, etc.)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>