2

I want to make a raster band that gives the incidence angle for each pixel in a radarsat-2 scene. I know this is possible using the information given in the product.xml file (below), but I'm not sure of the exact calculation.

I am aware that this is easily done with commercial remote sensing software, but I am looking for an open-source solution using python / gdal.

<product xmlns="http://www.rsi.ca/rs2/prod/xml/schemas" copyright="RADARSAT-2 Data and Products (c) MacDonald, Dettwiler and Associates Ltd., 2008 - All Rights Reserved." xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.rsi.ca/rs2/prod/xml/schemas schemas/rs2prod_product.xsd">
<productId>PDS_05117090</productId>
<documentIdentifier>RN-RP-51-2713, Issue 1/13</documentIdentifier>
<sourceAttributes>
    <satellite>RADARSAT-2</satellite>
    <sensor>SAR</sensor>
    <inputDatasetId>/Fred/RSAT-2/78964P</inputDatasetId>
    <imageId>14479</imageId>
    <inputDatasetFacilityId>Not Specified</inputDatasetFacilityId>
    <beamModeId>202</beamModeId>
    <beamModeMnemonic>W2</beamModeMnemonic>
    <rawDataStartTime>2008-08-14T02:00:27.661499Z</rawDataStartTime>
    <radarParameters>
        <acquisitionType>Wide</acquisitionType>
        <beams>W2</beams>
        <polarizations>HH HV</polarizations>
        <pulses>11.58</pulses>
        <rank beam="W2">8</rank>
        <settableGain beam="W2" pole="HH" wing="Combined" units="dB">5.177193818643510e-07</settableGain>
        <settableGain beam="W2" pole="HV" wing="Combined" units="dB">5.177193818643510e-07</settableGain>
        <radarCenterFrequency units="Hz">5.404999242769673e+09</radarCenterFrequency>
        <pulseRepetitionFrequency beam="W2" units="Hz">1.336283569335938e+03</pulseRepetitionFrequency>
        <pulseLength pulse="11.58" units="s">4.152204895019531e-05</pulseLength>
        <pulseBandwidth pulse="11.58" units="Hz">1.159710786000000e+07</pulseBandwidth>
        <antennaPointing>Right</antennaPointing>
        <adcSamplingRate pulse="11.58" units="Hz">1.266796875000000e+07</adcSamplingRate>
        <yawSteeringFlag>YawSteeringOn</yawSteeringFlag>
        <geodeticFlag>Off-Geocentric</geodeticFlag>
        <rawBitsPerSample>3</rawBitsPerSample>
        <samplesPerEchoLine beam="W2">7920</samplesPerEchoLine>
        <referenceNoiseLevel incidenceAngleCorrection="Beta Nought">
            <pixelFirstNoiseValue>0</pixelFirstNoiseValue>
            <stepSize>123</stepSize>
            <numberOfNoiseLevelValues>99</numberOfNoiseLevelValues>
            <noiseLevelValues units="dB">-2.36482391e+01 -2.40349693e+01 -2.43859901e+01 -2.47115707e+01 -2.50224609e+01 -2.53157692e+01 -2.55747299e+01 -2.57846909e+01 -2.59396591e+01 -2.60530796e+01 -2.61148205e+01 -2.61523895e+01 -2.61668205e+01 -2.61492195e+01 -2.60987892e+01 -2.60131702e+01 -2.59042892e+01 -2.57774391e+01 -2.56277409e+01 -2.54645195e+01 -2.52875004e+01 -2.51188698e+01 -2.49506207e+01 -2.47988605e+01 -2.46550598e+01 -2.45387001e+01 -2.44472408e+01 -2.43860703e+01 -2.43540192e+01 -2.43581104e+01 -2.44033203e+01 -2.44902096e+01 -2.46075706e+01 -2.47545109e+01 -2.49327793e+01 -2.51365509e+01 -2.53631401e+01 -2.55979004e+01 -2.58374100e+01 -2.60682907e+01 -2.62849808e+01 -2.64943504e+01 -2.66840096e+01 -2.68622208e+01 -2.70134106e+01 -2.71392899e+01 -2.72338791e+01 -2.73066406e+01 -2.73449593e+01 -2.73463993e+01 -2.73117695e+01 -2.72479591e+01 -2.71713600e+01 -2.70773697e+01 -2.69650898e+01 -2.68264198e+01 -2.66632004e+01 -2.64820805e+01 -2.62939205e+01 -2.61042004e+01 -2.59240799e+01 -2.57496109e+01 -2.55987606e+01 -2.54650898e+01 -2.53635597e+01 -2.52805405e+01 -2.52307701e+01 -2.52014904e+01 -2.52139397e+01 -2.52649002e+01 -2.53552704e+01 -2.54775906e+01 -2.56228504e+01 -2.57909508e+01 -2.59724503e+01 -2.61734600e+01 -2.63733597e+01 -2.65793400e+01 -2.67775192e+01 -2.69686604e+01 -2.71469193e+01 -2.73009701e+01 -2.74289894e+01 -2.75304108e+01 -2.76074104e+01 -2.76616898e+01 -2.76941795e+01 -2.77036495e+01 -2.76738605e+01 -2.76113892e+01 -2.75110397e+01 -2.73664494e+01 -2.71836491e+01 -2.69507008e+01 -2.66795292e+01 -2.63792992e+01 -2.60410500e+01 -2.56688499e+01 -2.52518406e+01</noiseLevelValues>
        </referenceNoiseLevel>
        <referenceNoiseLevel incidenceAngleCorrection="Sigma Nought">
            <pixelFirstNoiseValue>0</pixelFirstNoiseValue>
            <stepSize>123</stepSize>
            <numberOfNoiseLevelValues>99</numberOfNoiseLevelValues>
            <noiseLevelValues units="dB">-2.65736904e+01 -2.69480495e+01 -2.72867508e+01 -2.76000900e+01 -2.78988094e+01 -2.81800098e+01 -2.84269295e+01 -2.86249104e+01 -2.87679691e+01 -2.88695393e+01 -2.89194908e+01 -2.89453392e+01 -2.89480991e+01 -2.89188995e+01 -2.88569393e+01 -2.87598400e+01 -2.86395397e+01 -2.85013409e+01 -2.83403492e+01 -2.81658897e+01 -2.79776897e+01 -2.77979507e+01 -2.76186295e+01 -2.74558792e+01 -2.73011303e+01 -2.71738892e+01 -2.70716000e+01 -2.69996490e+01 -2.69568806e+01 -2.69503098e+01 -2.69849205e+01 -2.70612392e+01 -2.71681099e+01 -2.73046093e+01 -2.74724903e+01 -2.76659298e+01 -2.78822308e+01 -2.81067600e+01 -2.83360996e+01 -2.85568504e+01 -2.87634602e+01 -2.89628105e+01 -2.91424904e+01 -2.93107891e+01 -2.94521008e+01 -2.95681591e+01 -2.96529808e+01 -2.97160091e+01 -2.97446594e+01 -2.97364807e+01 -2.96922607e+01 -2.96189194e+01 -2.95328503e+01 -2.94294300e+01 -2.93077507e+01 -2.91597404e+01 -2.89872303e+01 -2.87968693e+01 -2.85995007e+01 -2.84006310e+01 -2.82113991e+01 -2.80278606e+01 -2.78679905e+01 -2.77253494e+01 -2.76148796e+01 -2.75229797e+01 -2.74643593e+01 -2.74262791e+01 -2.74299698e+01 -2.74722195e+01 -2.75539093e+01 -2.76676006e+01 -2.78042793e+01 -2.79638195e+01 -2.81368198e+01 -2.83293591e+01 -2.85208397e+01 -2.87184391e+01 -2.89082794e+01 -2.90911102e+01 -2.92611103e+01 -2.94069405e+01 -2.95267792e+01 -2.96200504e+01 -2.96889591e+01 -2.97351704e+01 -2.97596302e+01 -2.97611103e+01 -2.97233791e+01 -2.96529903e+01 -2.95447598e+01 -2.93923397e+01 -2.92017403e+01 -2.89610195e+01 -2.86821308e+01 -2.83742104e+01 -2.80283108e+01 -2.76484909e+01 -2.72238808e+01</noiseLevelValues>
        </referenceNoiseLevel>
        <referenceNoiseLevel incidenceAngleCorrection="Gamma">
            <pixelFirstNoiseValue>0</pixelFirstNoiseValue>
            <stepSize>123</stepSize>
            <numberOfNoiseLevelValues>99</numberOfNoiseLevelValues>
            <noiseLevelValues units="dB">-2.59199600e+01 -2.62899494e+01 -2.66242809e+01 -2.69332409e+01 -2.72275600e+01 -2.75043602e+01 -2.77468700e+01 -2.79404297e+01 -2.80790501e+01 -2.81761799e+01 -2.82216892e+01 -2.82430706e+01 -2.82413597e+01 -2.82076893e+01 -2.81412392e+01 -2.80396404e+01 -2.79148407e+01 -2.77721195e+01 -2.76066093e+01 -2.74276104e+01 -2.72348709e+01 -2.70505791e+01 -2.68666992e+01 -2.66993809e+01 -2.65400505e+01 -2.64082298e+01 -2.63013401e+01 -2.62247906e+01 -2.61774101e+01 -2.61662197e+01 -2.61961994e+01 -2.62678909e+01 -2.63701096e+01 -2.65019493e+01 -2.66651707e+01 -2.68539391e+01 -2.70655594e+01 -2.72854004e+01 -2.75100403e+01 -2.77261009e+01 -2.79279900e+01 -2.81226196e+01 -2.82975807e+01 -2.84611397e+01 -2.85977097e+01 -2.87090092e+01 -2.87890701e+01 -2.88473396e+01 -2.88712196e+01 -2.88582497e+01 -2.88092499e+01 -2.87311096e+01 -2.86402302e+01 -2.85319996e+01 -2.84055004e+01 -2.82526703e+01 -2.80753193e+01 -2.78801193e+01 -2.76779003e+01 -2.74741707e+01 -2.72800694e+01 -2.70916691e+01 -2.69269295e+01 -2.67793903e+01 -2.66640301e+01 -2.65672302e+01 -2.65037098e+01 -2.64607105e+01 -2.64594898e+01 -2.64968109e+01 -2.65735703e+01 -2.66823101e+01 -2.68140392e+01 -2.69686394e+01 -2.71366806e+01 -2.73242493e+01 -2.75107594e+01 -2.77033806e+01 -2.78882198e+01 -2.80660706e+01 -2.82310696e+01 -2.83718891e+01 -2.84867096e+01 -2.85749702e+01 -2.86388493e+01 -2.86800404e+01 -2.86994591e+01 -2.86958904e+01 -2.86531105e+01 -2.85776691e+01 -2.84643707e+01 -2.83068810e+01 -2.81112099e+01 -2.78654099e+01 -2.75814400e+01 -2.72684307e+01 -2.69174309e+01 -2.65324993e+01 -2.61027908e+01</noiseLevelValues>
        </referenceNoiseLevel>
    </radarParameters>
    <rawDataAttributes>
        <numberOfInputDataGaps>0</numberOfInputDataGaps>
        <gapSize>100</gapSize>
        <numberOfMissingLines pole="HH">0</numberOfMissingLines>
        <numberOfMissingLines pole="HV">0</numberOfMissingLines>
        <rawDataAnalysis pole="HH" wing="Combined" pulse="11.58">
            <bias dataStream="Real">-4.14525181e-01</bias>
            <bias dataStream="Imaginary">-7.21252143e-01</bias>
            <standardDeviation dataStream="Real">2.02034264e+01</standardDeviation>
            <standardDeviation dataStream="Imaginary">2.16105709e+01</standardDeviation>
            <gainImbalance>8.740123504030386e-01</gainImbalance>
            <phaseOrthogonality units="deg">-1.95242596e+00</phaseOrthogonality>
            <rawDataHistogram dataStream="Real">0 0 0 0 0 0 0 220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 811 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2166 0 0 0 0 0 0 545 0 0 0 0 0 0 13178 0 0 0 0 1705 0 0 0 0 0 82217 0 0 0 0 5377 0 0 0 0 211300 0 0 1084 32191 0 0 0 112307 0 3535 189198 0 0 55473 0 0 425402 0 0 27418 0 289062 0 0 39561 0 506880 0 14721 0 936992 1536 23399 544169 16184 214548 43671 35124 130695 237781 589179 97186 1233691 655603 407496 358965 381126 181806 348537 1086 1041 329459 172704 331434 323926 392569 642462 1220452 84695 576670 223467 121653 26838 41073 208169 13491 526316 19147 1570 916064 0 12041 0 494114 0 33981 0 0 275858 0 23294 0 0 406608 0 0 48724 0 0 181271 3437 0 99266 0 0 0 30803 1131 0 0 188337 0 0 0 0 4958 0 0 0 0 74462 0 0 0 0 0 1602 0 0 0 0 11568 0 0 0 0 0 0 605 0 0 0 0 0 0 1909 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 605 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 221 0 0 0 0 0 0 0</rawDataHistogram>
            <rawDataHistogram dataStream="Imaginary">0 0 0 0 0 0 0 306 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1047 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3148 0 0 0 0 0 0 590 0 0 0 0 0 0 18782 0 0 0 0 1806 0 0 0 0 0 116884 0 0 0 0 5775 0 0 0 0 286204 0 0 1094 35974 0 0 0 152869 0 3360 208972 0 0 75647 0 0 463770 0 0 36314 0 309558 0 0 51380 0 515030 0 19877 0 930794 1472 31615 542892 20306 213677 46028 49951 133578 243992 566156 104034 1155837 624423 392493 345149 345258 169329 322631 985 983 303511 161304 328257 307256 365815 598388 1135472 83383 537905 214196 119298 31642 40544 201274 15235 514542 23321 1521 891878 0 15046 0 489458 0 42262 0 0 287138 0 30067 0 0 433526 0 0 63119 0 0 194543 3402 0 130090 0 0 0 33886 1050 0 0 246003 0 0 0 0 5420 0 0 0 0 99518 0 0 0 0 0 1766 0 0 0 0 15777 0 0 0 0 0 0 600 0 0 0 0 0 0 2593 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 865 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 279 0 0 0 0 0 0 0</rawDataHistogram>
        </rawDataAnalysis>
        <rawDataAnalysis pole="HV" wing="Combined" pulse="11.58">
            <bias dataStream="Real">-4.19891030e-01</bias>
            <bias dataStream="Imaginary">-5.42523682e-01</bias>
            <standardDeviation dataStream="Real">9.97403049e+00</standardDeviation>
            <standardDeviation dataStream="Imaginary">1.06447906e+01</standardDeviation>
            <gainImbalance>8.779446059786586e-01</gainImbalance>
            <phaseOrthogonality units="deg">-3.20893741e+00</phaseOrthogonality>
            <rawDataHistogram dataStream="Real">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 135 0 0 0 0 0 0 0 343 0 0 0 0 0 3731 0 0 289 0 0 70107 0 704 0 0 254733 0 11237 0 115219 0 156228 0 100050 540972 25375 22258 240518 49954 450446 888436 80010 445775 328223 122099 194371 635729 2336047 796250 714927 47497 41515 646664 722041 2224111 607617 161957 77696 301225 408592 61111 834564 414512 38118 215013 21146 19698 488245 80799 0 141108 0 95176 0 10173 0 214623 0 0 638 0 59279 0 0 295 0 0 3129 0 0 0 0 0 303 0 0 0 0 0 0 0 109 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
            <rawDataHistogram dataStream="Imaginary">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 189 0 0 0 0 0 0 0 449 0 0 0 0 0 5303 0 0 320 0 0 95885 0 750 0 0 338683 0 12680 0 152635 0 170674 0 131071 581756 33719 22131 259564 65026 456662 883734 95214 442528 323120 153981 201476 602049 2211448 759903 672735 40954 38413 590951 671540 2086714 570532 162888 91582 293389 401516 69414 820096 415746 46350 228902 20899 24465 517892 102427 0 152351 0 123517 0 11293 0 279782 0 0 733 0 79870 0 0 292 0 0 4385 0 0 0 0 0 390 0 0 0 0 0 0 0 152 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</rawDataHistogram>
        </rawDataAnalysis>
    </rawDataAttributes>
    <orbitAndAttitude>
        <orbitInformation>
            <passDirection>Ascending</passDirection>
            <orbitDataSource>Definitive</orbitDataSource>
            <orbitDataFile>03480_DEF.ORB</orbitDataFile>
            <stateVector>
                <timeStamp>2008-08-14T02:00:28.077415Z</timeStamp>
                <xPosition units="m">-3.075640178649734e+06</xPosition>
                <yPosition units="m">-3.752866109595124e+06</yPosition>
                <zPosition units="m">5.271839846972020e+06</zPosition>
                <xVelocity units="m/s">1.852641828088696e+03</xVelocity>
                <yVelocity units="m/s">5.411187943475534e+03</yVelocity>
                <zVelocity units="m/s">4.920992250090444e+03</zVelocity>
            </stateVector>
            <stateVector>
                <timeStamp>2008-08-14T02:00:33.809494Z</timeStamp>
                <xPosition units="m">-3.064953402824016e+06</xPosition>
                <yPosition units="m">-3.721787054654803e+06</yPosition>
                <zPosition units="m">5.299953306896454e+06</zPosition>
                <xVelocity units="m/s">1.876110957508967e+03</xVelocity>
                <yVelocity units="m/s">5.432679989621240e+03</yVelocity>
                <zVelocity units="m/s">4.888145662504752e+03</zVelocity>
            </stateVector>
            <stateVector>
                <timeStamp>2008-08-14T02:00:39.541572Z</timeStamp>
                <xPosition units="m">-3.054132241250712e+06</xPosition>
                <yPosition units="m">-3.690585418365609e+06</yPosition>
                <zPosition units="m">5.327877984661524e+06</zPosition>
                <xVelocity units="m/s">1.899531327551277e+03</xVelocity>
                <yVelocity units="m/s">5.453960012402523e+03</yVelocity>
                <zVelocity units="m/s">4.855125497221166e+03</zVelocity>
            </stateVector>
            <stateVector>
                <timeStamp>2008-08-14T02:00:45.273651Z</timeStamp>
                <xPosition units="m">-3.043176972496275e+06</xPosition>
                <yPosition units="m">-3.659262407205476e+06</yPosition>
                <zPosition units="m">5.355612898423979e+06</zPosition>
                <xVelocity units="m/s">1.922901942962390e+03</xVelocity>
                <yVelocity units="m/s">5.475027315084119e+03</yVelocity>
                <zVelocity units="m/s">4.821932926684948e+03</zVelocity>
            </stateVector>
            <stateVector>
                <timeStamp>2008-08-14T02:00:51.005730Z</timeStamp>
                <xPosition units="m">-3.032087886553725e+06</xPosition>
                <yPosition units="m">-3.627819247958946e+06</yPosition>
                <zPosition units="m">5.383157058485363e+06</zPosition>
                <xVelocity units="m/s">1.946221794930945e+03</xVelocity>
                <yVelocity units="m/s">5.495881191420501e+03</yVelocity>
                <zVelocity units="m/s">4.788569141485724e+03</zVelocity>
            </stateVector>
        </orbitInformation>
        <attitudeInformation>
            <attitudeDataSource>Downlink</attitudeDataSource>
            <attitudeOffsetsApplied>true</attitudeOffsetsApplied>
            <attitudeAngles>
                <timeStamp>2008-08-14T02:00:28.077415Z</timeStamp>
                <yaw units="deg">-2.621060644238963e+00</yaw>
                <roll units="deg">-2.980286719296127e+01</roll>
                <pitch units="deg">6.696343747006632e-03</pitch>
            </attitudeAngles>
            <attitudeAngles>
                <timeStamp>2008-08-14T02:00:33.809494Z</timeStamp>
                <yaw units="deg">-2.602819387284850e+00</yaw>
                <roll units="deg">-2.980081332557578e+01</roll>
                <pitch units="deg">6.074817046873744e-03</pitch>
            </attitudeAngles>
            <attitudeAngles>
                <timeStamp>2008-08-14T02:00:39.541572Z</timeStamp>
                <yaw units="deg">-2.587051198787101e+00</yaw>
                <roll units="deg">-2.979559969802717e+01</roll>
                <pitch units="deg">6.389272991150528e-03</pitch>
            </attitudeAngles>
            <attitudeAngles>
                <timeStamp>2008-08-14T02:00:45.273651Z</timeStamp>
                <yaw units="deg">-2.570331742365635e+00</yaw>
                <roll units="deg">-2.979241150164189e+01</roll>
                <pitch units="deg">5.879630753788156e-03</pitch>
            </attitudeAngles>
            <attitudeAngles>
                <timeStamp>2008-08-14T02:00:51.005730Z</timeStamp>
                <yaw units="deg">-2.553390404623114e+00</yaw>
                <roll units="deg">-2.979451322216491e+01</roll>
                <pitch units="deg">4.648591581846009e-03</pitch>
            </attitudeAngles>
        </attitudeInformation>
    </orbitAndAttitude>
</sourceAttributes>
<imageGenerationParameters>
    <generalProcessingInformation>
        <productType>SGF</productType>
        <processingFacility>GSS</processingFacility>
        <processingTime>2016-05-10T00:24:58.000000Z</processingTime>
        <softwareVersion>CAPPS SAR 1.3</softwareVersion>
    </generalProcessingInformation>
    <sarProcessingInformation>
        <lutApplied>Mixed</lutApplied>
        <elevationPatternCorrection>true</elevationPatternCorrection>
        <rangeSpreadingLossCorrection>true</rangeSpreadingLossCorrection>
        <pulseDependantGainCorrection>true</pulseDependantGainCorrection>
        <receiverSettableGain>true</receiverSettableGain>
        <rawDataCorrection>true</rawDataCorrection>
        <rangeReferenceFunctionSource>Nominal Chirp</rangeReferenceFunctionSource>
        <interPolarizationMatricesCorrection>false</interPolarizationMatricesCorrection>
        <dopplerSource>Adaptive Analysis</dopplerSource>
        <dopplerAmbiguityComputed>false</dopplerAmbiguityComputed>
        <dopplerAmbiguityUsed>false</dopplerAmbiguityUsed>
        <estimatedRollAngleUsed>false</estimatedRollAngleUsed>
        <radiometricSmoothingPerformed>false</radiometricSmoothingPerformed>
        <zeroDopplerTimeFirstLine>2008-08-14T02:00:51.005730Z</zeroDopplerTimeFirstLine>
        <zeroDopplerTimeLastLine>2008-08-14T02:00:28.077415Z</zeroDopplerTimeLastLine>
        <numberOfLinesProcessed pole="HH">31286</numberOfLinesProcessed>
        <numberOfLinesProcessed pole="HV">31286</numberOfLinesProcessed>
        <samplingWindowStartTimeFirstRawLine beam="W2" units="s">8.695948196114709e-05</samplingWindowStartTimeFirstRawLine>
        <samplingWindowStartTimeLastRawLine beam="W2" units="s">8.695948196114709e-05</samplingWindowStartTimeLastRawLine>
        <numberOfSwstChanges beam="W2">0</numberOfSwstChanges>
        <numberOfRangeLooks>1</numberOfRangeLooks>
        <rangeLookBandwidth units="Hz">1.159711000000000e+07</rangeLookBandwidth>
        <totalProcessedRangeBandwidth units="Hz">1.159711000000000e+07</totalProcessedRangeBandwidth>
        <numberOfAzimuthLooks>4</numberOfAzimuthLooks>
        <scalarLookWeights>1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00 1.000000000000000e+00</scalarLookWeights>
        <azimuthLookBandwidth units="Hz">2.930000000000000e+02</azimuthLookBandwidth>
        <totalProcessedAzimuthBandwidth units="Hz">8.300000000000000e+02</totalProcessedAzimuthBandwidth>
        <azimuthWindow>
            <windowName>Kaiser</windowName>
            <windowCoefficient>2.90000010e+00</windowCoefficient>
        </azimuthWindow>
        <rangeWindow>
            <windowName>Kaiser</windowName>
            <windowCoefficient>2.79999995e+00</windowCoefficient>
        </rangeWindow>
        <incidenceAngleNearRange units="deg">3.06548271e+01</incidenceAngleNearRange>
        <incidenceAngleFarRange units="deg">3.94729424e+01</incidenceAngleFarRange>
        <slantRangeNearEdge units="m">9.103531841981832e+05</slantRangeNearEdge>
        <satelliteHeight units="m">7.985133125000000e+05</satelliteHeight>
    </sarProcessingInformation>
    <dopplerCentroid>
        <timeOfDopplerCentroidEstimate>2008-08-14T02:00:39.541572Z</timeOfDopplerCentroidEstimate>
        <dopplerAmbiguity>0</dopplerAmbiguity>
        <dopplerAmbiguityConfidence>0.000000000000000e+00</dopplerAmbiguityConfidence>
        <dopplerCentroidReferenceTime units="s">6.072669290000000e-03</dopplerCentroidReferenceTime>
        <dopplerCentroidPolynomialPeriod units="s">5.836768406298754e-04</dopplerCentroidPolynomialPeriod>
        <dopplerCentroidCoefficients>3.464063242735000e+02 -4.850574131400000e+04 7.539164066000000e+06</dopplerCentroidCoefficients>
        <dopplerCentroidConfidence>9.879872202873230e-01</dopplerCentroidConfidence>
    </dopplerCentroid>
    <dopplerRateValues>
        <dopplerRateReferenceTime units="s">6.072669290000000e-03</dopplerRateReferenceTime>
        <dopplerRateValuesCoefficients>-1.986462764500000e+03 3.410792916993632e+05 -5.070253231000000e+07</dopplerRateValuesCoefficients>
    </dopplerRateValues>
    <chirp pole="HH" wing="Combined" pulse="11.58">
        <chirpQuality>
            <replicaQualityValid>true</replicaQualityValid>
            <crossCorrelationWidth>9.645782113075256e-01</crossCorrelationWidth>
            <sideLobeLevel units="dB">-1.313166999816895e+01</sideLobeLevel>
            <integratedSideLobeRatio units="dB">-1.019987010955811e+01</integratedSideLobeRatio>
            <crossCorrelationPeakLoc>3.821015167236328e+01</crossCorrelationPeakLoc>
        </chirpQuality>
        <chirpPower units="dB">6.405596279545746e+01</chirpPower>
        <amplitudeCoefficients>1.00000000e+00 -5.90028381e+02 -8.01294800e+07 -2.84116989e+12</amplitudeCoefficients>
        <phaseCoefficients>9.03649390e-01 5.01745508e+03 -1.39632394e+11 -1.18661094e+12</phaseCoefficients>
    </chirp>
    <chirp pole="HV" wing="Combined" pulse="11.58">
        <chirpQuality>
            <replicaQualityValid>true</replicaQualityValid>
            <crossCorrelationWidth>9.615061879158020e-01</crossCorrelationWidth>
            <sideLobeLevel units="dB">-1.323206996917725e+01</sideLobeLevel>
            <integratedSideLobeRatio units="dB">-1.003649044036865e+01</integratedSideLobeRatio>
            <crossCorrelationPeakLoc>3.820959472656250e+01</crossCorrelationPeakLoc>
        </chirpQuality>
        <chirpPower units="dB">6.412706090695785e+01</chirpPower>
        <amplitudeCoefficients>1.00000000e+00 -8.16091370e+02 -2.55068800e+07 -1.90230299e+12</amplitudeCoefficients>
        <phaseCoefficients>3.40841800e-01 4.80201318e+03 -1.39639407e+11 -8.28603302e+11</phaseCoefficients>
    </chirp>
    <slantRangeToGroundRange>
        <zeroDopplerAzimuthTime>2008-08-14T02:00:39.541572Z</zeroDopplerAzimuthTime>
        <slantRangeTimeToFirstRangeSample units="s">6.073222723956473e-03</slantRangeTimeToFirstRangeSample>
        <groundRangeOrigin units="m">0.000000000000000e+00</groundRangeOrigin>
        <groundToSlantRangeCoefficients>9.103531841981832e+05 5.098610142100000e-01 4.737930920900000e-07 -2.681528959700000e-13 3.468563666000000e-20 7.001241719600000e-26</groundToSlantRangeCoefficients>
    </slantRangeToGroundRange>
    <payloadCharacteristicsParameterFile>PCP_beam_E2008_04_25_00_00_00_G2011_07_22_00_00_00.xml</payloadCharacteristicsParameterFile>
    <payloadCharacteristicsParameterFile>PCP_baq_E2007_12_14_00_00_00_G2008_01_08_00_00_00.xml</payloadCharacteristicsParameterFile>
    <payloadCharacteristicsParameterFile>PCP_instrument_E2008_07_25_13_45_00_G2015_06_15_00_00_00.xml</payloadCharacteristicsParameterFile>
    <payloadCharacteristicsParameterFile>PCP_pulse_E2008_07_25_13_45_00_G2009_12_17_00_00_00.xml</payloadCharacteristicsParameterFile>
    <payloadCharacteristicsParameterFile>PCP_polarimetric_E2008_04_25_00_00_00_G2008_10_17_00_00_00.xml</payloadCharacteristicsParameterFile>
    <payloadCharacteristicsParameterFile>PCP_spotlight_E2007_12_14_00_00_00_G2009_01_22_12_00_00.xml</payloadCharacteristicsParameterFile>
</imageGenerationParameters>
<imageAttributes>
    <productFormat>GeoTIFF</productFormat>
    <outputMediaInterleaving>BSQ</outputMediaInterleaving>
    <rasterAttributes>
        <dataType>Magnitude Detected</dataType>
        <bitsPerSample dataStream="Magnitude">16</bitsPerSample>
        <numberOfSamplesPerLine>12131</numberOfSamplesPerLine>
        <numberOfLines>12164</numberOfLines>
        <sampledPixelSpacing units="m">1.25000000e+01</sampledPixelSpacing>
        <sampledLineSpacing units="m">1.25000000e+01</sampledLineSpacing>
        <lineTimeOrdering>Decreasing</lineTimeOrdering>
        <pixelTimeOrdering>Increasing</pixelTimeOrdering>
    </rasterAttributes>
    <geographicInformation>
        <geolocationGrid>
            <imageTiePoint>
                <imageCoordinate>
                    <line>0.00000000e+00</line>
                    <pixel>0.00000000e+00</pixel>
                </imageCoordinate>
                <geodeticCoordinate>
                    <latitude units="deg">4.975714827349214e+01</latitude>
                    <longitude units="deg">-1.243741196975051e+02</longitude>
                    <height units="m">3.751306152343750e+02</height>
                </geodeticCoordinate>
            </imageTiePoint>
        </geolocationGrid>
        <rationalFunctions>
            <biasError units="m">5.000000000000000e-01</biasError>
            <randomError units="m">5.000000000000000e-01</randomError>
            <lineFitQuality>2.128622337829517e-04</lineFitQuality>
            <pixelFitQuality>3.197997800530086e-03</pixelFitQuality>
            <lineOffset>6081</lineOffset>
            <pixelOffset>6065</pixelOffset>
            <latitudeOffset units="deg">4.921160000000000e+01</latitudeOffset>
            <longitudeOffset units="deg">-1.231583000000000e+02</longitudeOffset>
            <heightOffset units="m">3.750000000000000e+02</heightOffset>
            <lineScale>6082</lineScale>
            <pixelScale>6066</pixelScale>
            <latitudeScale>7.989000000000001e-01</latitudeScale>
            <longitudeScale>1.232000000000000e+00</longitudeScale>
            <heightScale>7.010000000000000e+02</heightScale>
            <lineNumeratorCoefficients>4.116650224927845e-03 2.179180487631955e-01 -1.148296332227965e+00 -1.817174768618719e-05 -3.078652037317352e-03 -6.806339201398421e-08 -7.741350669343577e-08 -9.404975667469014e-03 -2.975731798817540e-03 0.000000000000000e+00 -1.212300682495027e-07 5.450073757515900e-06 -1.349720975219812e-05 -1.234800613073165e-06 3.398001640574943e-06 -4.215276933273179e-06 6.515971617073355e-06 2.505009646233278e-08 1.599786549771633e-08 0.000000000000000e+00</lineNumeratorCoefficients>
            <lineDenominatorCoefficients>1.000000000000000e+00 -2.382583976924958e-03 1.980303380693272e-03 0.000000000000000e+00 -7.060931364158146e-06 1.048872364661941e-07 0.000000000000000e+00 6.952561687934494e-06 6.122185037404424e-07 -5.673802694705565e-06 0.000000000000000e+00 1.401564501433224e-07 7.296512953115048e-07 1.366299771399191e-08 3.170004355801539e-06 2.663595566343175e-07 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00</lineDenominatorCoefficients>
            <pixelNumeratorCoefficients>-1.598529412487025e-02 1.162827493238576e+00 2.193999881073289e-01 -1.309433242565428e-02 -5.612823632973054e-03 9.307041548411361e-04 6.101188163881923e-05 1.059692159189906e-02 6.503363601759626e-04 1.015180669009072e-05 -7.264189801064628e-05 -4.136035449250312e-06 -1.296042279065923e-04 -8.472511309944471e-05 -3.236019195669411e-05 3.635055007801646e-06 -1.641797780877858e-05 -2.886492143750424e-04 -2.993679756930679e-06 1.000828445915950e-06</pixelNumeratorCoefficients>
            <pixelDenominatorCoefficients>1.000000000000000e+00 7.510750266817361e-03 9.876908679047180e-03 -1.259095297714457e-03 1.219469374049901e-05 1.216550431104855e-04 5.123583933646678e-05 4.740772869386544e-05 1.173565534845165e-04 -7.434130211933621e-05 -3.238835943399982e-05 -4.073801445890826e-06 9.483170248670864e-06 7.920764042604160e-07 1.522143137135112e-05 2.607253658801927e-06 -1.166042324762085e-06 -6.651234745668952e-05 -1.968999040797388e-06 8.252577948303840e-08</pixelDenominatorCoefficients>
        </rationalFunctions>
        <referenceEllipsoidParameters>
            <ellipsoidName>WGS 1984</ellipsoidName>
            <semiMajorAxis units="m">6.378137000000000e+06</semiMajorAxis>
            <semiMinorAxis units="m">6.356752314245179e+06</semiMinorAxis>
            <datumShiftParameters units="m">0.000000000000000e+00 0.000000000000000e+00 0.000000000000000e+00</datumShiftParameters>
            <geodeticTerrainHeight units="m">3.751306152343750e+02</geodeticTerrainHeight>
        </referenceEllipsoidParameters>
    </geographicInformation>
    <radiometricInformation pole="HH">
        <mean dataStream="Magnitude">5.801196495198800e+03</mean>
        <standardDeviation dataStream="Magnitude">4.770691524886200e+03</standardDeviation>
    </radiometricInformation>
    <radiometricInformation pole="HV">
        <mean dataStream="Magnitude">2.810900639218000e+03</mean>
        <standardDeviation dataStream="Magnitude">2.067762161723700e+03</standardDeviation>
    </radiometricInformation>
    <lookupTable incidenceAngleCorrection="Beta Nought">lutBeta.xml</lookupTable>
    <lookupTable incidenceAngleCorrection="Sigma Nought">lutSigma.xml</lookupTable>
    <lookupTable incidenceAngleCorrection="Gamma">lutGamma.xml</lookupTable>
    <fullResolutionImageData pole="HH">imagery_HH.tif</fullResolutionImageData>
    <fullResolutionImageData pole="HV">imagery_HV.tif</fullResolutionImageData>
</imageAttributes>

1 Answer 1

2

If you are working in range-Doppler (not projected), you can exploit the information contained in the calibration gains. RS-2 products are generated using an "Application LUT", which aims to correct incidence angle effects to produce a nicely viewable DN image. The calibration gains contain both the calibration factor, but also the factor necessary to restore the original incidence angle dependency in the calibrated image.

The incidence angle in radians can be recovered by taking the ratio the beta nought and sigma nought calibration gains:

theta = arcsin(beta_gains / sigma_gains)

For complex data, square the gains; for detected data use as-is.

You can validate the values using the near range and far range incidence angles provided in the product.xml metadata.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.