<div dir="ltr"><div dir="ltr"><div>Oh very cool, thanks!</div><div>So that appears to work for getting the Derived band (pasted below), but I've got 2 followups</div><div><br></div><div>1.
 is there any way to access the nested VRT? So for this one .vrt, it 
would have one band as Float32 (the derived phase), and one as CFloat32 
(the original raw file). Or are the different datatypes not allowed as 
different bands in one raster?<br></div><div>2. If I wanted to have two derived bands (say, a logamp derived band), would I need to copy the CDATA section twice?</div><div><br></div><div>Thanks (apologies for the mis-reply the first time)<br></div><div><br></div><div><div><br></div><div>(This loaded correctly, but only has 1 band)</div><div><br></div><div><span class="gmail-im"><VRTDataset rasterXSize="720" rasterYSize="720"><br>  <SRS>...</SRS><br>  <GeoTransform>  ...</GeoTransform><br>  <VRTRasterBand dataType="Float32" band="1" subClass="VRTDerivedRasterBand"><br></span>    <SimpleSource><br>      <SourceFilename><![CDATA[<span class="gmail-im"><br>        <VRTDataset rasterXSize="720" rasterYSize="720"><br>          <SRS>...</SRS><br>          <GeoTransform>  ...</GeoTransform><br>          <VRTRasterBand dataType="CFloat32" band="1" subClass="VRTRawRasterBand"><br>            <SourceFilename relativeToVRT="1"><a href="http://20160327_20160420.int" target="_blank">20160327_20160420.int</a></SourceFilename><br>            <ImageOffset>8</ImageOffset><br>            <PixelOffset>8</PixelOffset><br>            <LineOffset>5760</LineOffset><br>            <ByteOrder>LSB</ByteOrder><br>          </VRTRasterBand><br></span>        </VRTDataset><br>      ]]></SourceFilename><span class="gmail-im"><br>      <SourceBand>1</SourceBand><br>      <SourceProperties RasterXSize="720" RasterYSize="720" DataType="CFloat32" BlockXSize="720" BlockYSize="1" /><br>    </SimpleSource><br>    <PixelFunctionType>phase</PixelFunctionType><br>    <SourceTransferType>CFloat32</SourceTransferType><br>  </VRTRasterBand><br></VRTDataset></span></div></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 11, 2020 at 9:54 AM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On mercredi 11 mars 2020 09:49:49 CET Scott Staniewicz wrote:<br>
> Is it possible to have a VRTRawRasterBand and a VRTDerivedRasterBand, which<br>
> is derived from that Raw file, together as two bands in a single VRT file?<br>
> <br>
> <br>
> I've got a CFloat32 raster file with only one complex band in binary format<br>
> (called "<a href="http://20160327_20160420.int" rel="noreferrer" target="_blank">20160327_20160420.int</a>" in the example below), and I've figured out<br>
> how to make a VRT for it so I can load it with GDAL.<br>
> <br>
> "20160327_20160420.int.vrt":<br>
> <br>
> <VRTDataset rasterXSize="720" rasterYSize="720"><br>
>   <VRTRasterBand dataType="CFloat32" band="1" subClass="VRTRawRasterBand"><br>
>     <SourceFilename relativeToVRT="1"><a href="http://20160327_20160420.int" rel="noreferrer" target="_blank">20160327_20160420.int</a></SourceFilename><br>
> <ImageOffset>8</ImageOffset><br>
>     <PixelOffset>8</PixelOffset><br>
>     <LineOffset>5760</LineOffset><br>
>     <ByteOrder>LSB</ByteOrder><br>
>   </VRTRasterBand><br>
>   <SRS>WGS84</SRS><br>
>   <GeoTransform> ...</GeoTransform><br>
> </VRTDataset><br>
> <br>
> This works great. I've also figured out how to make a derived raster band<br>
> from this that shows the amplitude of the data, and also the phase (below):<br>
> <br>
> "20160327_20160420.int.phase.vrt":<br>
> <br>
> <VRTDataset rasterXSize="720" rasterYSize="720"><br>
>   <SRS>...</SRS><br>
>   <GeoTransform>  ...</GeoTransform><br>
>   <VRTRasterBand dataType="Float32" band="1"<br>
> subClass="VRTDerivedRasterBand"><br>
>     <Description>phase of 20160327_20160420.int.vrt </Description><br>
>     <SimpleSource><br>
>       <SourceFilename<br>
> relativeToVRT="1">20160327_20160420.int.vrt</SourceFilename><br>
>       <SourceBand>1</SourceBand><br>
>       <SourceProperties RasterXSize="720" RasterYSize="720"<br>
> DataType="CFloat32" BlockXSize="720" BlockYSize="1" /><br>
>     </SimpleSource><br>
>     <PixelFunctionType>phase</PixelFunctionType><br>
>     <SourceTransferType>CFloat32</SourceTransferType><br>
>   </VRTRasterBand><br>
> </VRTDataset><br>
> <br>
> But I can't figure out how I would get both of these as two bands in one<br>
> VRT without causing an infinite recursion. Is that possible? Or do I need<br>
> to keep them separate?<br>
<br>
In the top level VRT, instead of having<br>
<br>
<SourceFilename relativeToVRT="1">20160327_20160420.int.vrt</SourceFilename><br>
<br>
you can put the content of .int.vrt inline in a CDATA section<br>
<br>
<SourceFilename relativeToVRT="1"><![CDATA[put here content of <br>
20160327_20160420.int.vrt]]></SourceFilename><br>
<br>
See example from autotest suite:<br>
<a href="https://github.com/OSGeo/gdal/blob/master/autotest/gcore/data/vrtinvrt.vrt" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/blob/master/autotest/gcore/data/vrtinvrt.vrt</a><br>
<br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</blockquote></div></div>