<?xml version="1.0"?>
<!--
/******************************************************************************
 * $Id: nitf_spec.xml 24212 2012-04-08 18:41:59Z rouault $
 *
 * Project:  NITF Library
 * Purpose:  Description of NITF TREs
 * Author:   Even Rouault, <even dot rouault at mines dash paris dot org>
 *
 **********************************************************************
 * Copyright (c) 2011, Even Rouault
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 ****************************************************************************/
-->

<!-- This file should validate against nitf_spec.xsd -->

<tres>

    <tre name="ACCPOB" minlength="17" maxlength="99985" location="image">
        <field name="NUM_ACPO" length="2" type="integer" minval="1" maxval="99"/>
        <loop counter="NUM_ACPO" md_prefix="ACCPO_%02d_" name="ACCPO">
            <field name="UNIAAH" length="3" type="string"/>
            <if cond="UNIAAH!=">
                <field name="AAH" length="5" type="integer"/>
            </if>
            <field name="UNIAAV" length="3" type="string"/>
            <if cond="UNIAAV!=">
                <field name="AAV" length="5" type="integer"/>
            </if>
            <field name="UNIAPH" length="3" type="string"/>
            <if cond="UNIAPH!=">
                <field name="APH" length="5" type="integer"/>
            </if>
            <field name="UNIAPV" length="3" type="string"/>
            <if cond="UNIAPV!=">
                <field name="APV" length="5" type="integer"/>
            </if>
            <field name="NUM_PTS" length="3" type="integer"/>
            <loop counter="NUM_PTS" md_prefix="POINT_%03d_" name="POINT">
                <field name="LON" length="15" type="real"/>
                <field name="LAT" length="15" type="real"/>
            </loop>
        </loop>
    </tre>

    <tre name="ACFTB" length="207" location="image">
        <field name="AC_MSN_ID" length="20"/>
        <field name="AC_TAIL_NO" length="10"/>
        <field name="AC_TO" length="12"/>
        <field name="SENSOR_ID_TYPE" length="4"/>
        <field name="SENSOR_ID" length="6"/>
        <field name="SCENE_SOURCE" length="1"/>
        <field name="SCNUM" length="6"/>
        <field name="PDATE" length="8"/>
        <field name="IMHOSTNO" length="6"/>
        <field name="IMREQID" length="5"/>
        <field name="MPLAN" length="3"/>
        <field name="ENTLOC" length="25"/>
        <field name="LOC_ACCY" length="6"/>
        <field name="ENTELV" length="6"/>
        <field name="ELV_UNIT" length="1"/>
        <field name="EXITLOC" length="25"/>
        <field name="EXITELV" length="6"/>
        <field name="TMAP" length="7"/>
        <field name="ROW_SPACING" length="7"/>
        <field name="ROW_SPACING_UNITS" length="1"/>
        <field name="COL_SPACING" length="7"/>
        <field name="COL_SPACING_UNITS" length="1"/>
        <field name="FOCAL_LENGTH" length="6"/>
        <field name="SENSERIAL" length="6"/>
        <field name="ABSWVER" length="7"/>
        <field name="CAL_DATE" length="8"/>
        <field name="PATCH_TOT" length="4"/>
        <field name="MTI_TOT" length="3"/>
    </tre>

    <tre name="AIMIDB" length="89" location="image">
        <field name="ACQUISITION_DATE" length="14"/>
        <field name="MISSION_NO" length="4"/>
        <field name="MISSION_IDENTIFICATION" length="10"/>
        <field name="FLIGHT_NO" length="2"/>
        <field name="OP_NUM" length="3"/>
        <field name="CURRENT_SEGMENT" length="2"/>
        <field name="REPRO_NUM" length="2"/>
        <field name="REPLAY" length="3"/>
        <field name="RESERVED_1" length="1"/>
        <field name="START_TILE_COLUMN" length="3"/>
        <field name="START_TILE_ROW" length="5"/>
        <field name="END_SEGMENT" length="2"/>
        <field name="END_TILE_COLUMN" length="3"/>
        <field name="END_TILE_ROW" length="5"/>
        <field name="COUNTRY" length="2"/>
        <field name="RESERVED_2" length="4"/>
        <field name="LOCATION" length="11"/>
        <field name="RESERVED_3" length="13"/>
    </tre>

    <tre name="BLOCKA" length="123" location="image">
        <field name="BLOCK_INSTANCE" length="2" type="integer" minval="1" maxval="99"/>
        <field name="N_GRAY" length="5" type="integer" minval="0" maxval="99999"/>
        <field name="L_LINES" length="5" type="integer" minval="1" maxval="99999"/>
        <field name="LAYOVER_ANGLE" length="3" type="integer" minval="0" maxval="359" unit="degrees"/>
        <field name="SHADOW_ANGLE" length="3" type="integer" minval="0" maxval="359" unit="degrees"/>
        <field length="16"/>
        <field name="FRLC_LOC" length="21"/>
        <field name="LRLC_LOC" length="21"/>
        <field name="LRFC_LOC" length="21"/>
        <field name="FRFC_LOC" length="21"/>
        <field length="5"/>
    </tre>

    <tre name="BNDPLB" minlength="124" maxlength="99964" location="image">
        <field name="NUM_PTS" length="4" type="integer" minval="4" maxval="3332"/>
        <loop counter="NUM_PTS" md_prefix="POINT_%04d_" name="POINT">
            <field name="LON" length="15" type="real"/>
            <field name="LAT" length="15" type="real"/>
        </loop>
    </tre>

    <tre name="CSDIDA" md_prefix="NITF_CSDIDA_" length="70" location="file">
        <field name="DAY" length="2"/>
        <field name="MONTH" length="3"/>
        <field name="YEAR" length="4"/>
        <field name="PLATFORM_CODE" length="2"/>
        <field name="VEHICLE_ID" length="2"/>
        <field name="PASS" length="2"/>
        <field name="OPERATION" length="3"/>
        <field name="SENSOR_ID" length="2"/>
        <field name="PRODUCT_ID" length="2"/>
        <field name="RESERVED_0" length="4"/>
        <field name="TIME" length="14"/>
        <field name="PROCESS_TIME" length="14"/>
        <field name="RESERVED_1" length="2"/>
        <field name="RESERVED_2" length="2"/>
        <field name="RESERVED_3" length="1"/>
        <field name="RESERVED_4" length="1"/>
        <field name="SOFTWARE_VERSION_NUMBER" length="10"/>
    </tre>

    <tre name="CSEPHA" minlength="257" maxlength="36005" location="des">
        <field name="EPHEM_FLAG" length="12"/>
        <field name="DT_EPHEM" length="5"/>
        <field name="DATE_EPHEM" length="8"/>
        <field name="T0_EPHEM" length="13"/>
        <field name="NUM_EPHEM" length="3"/>
        <loop counter="NUM_EPHEM" md_prefix="EPHEM_%03d_" name="EPHEM">
            <field name="X" longname="EPHEM_X" length="12"/>
            <field name="Y" longname="EPHEM_Y" length="12"/>
            <field name="Z" longname="EPHEM_Z" length="12"/>
        </loop>
    </tre>

    <tre name="CSCRNA" length="109" location="image">
        <field name="PREDICT_CORNERS" length="1"/>
        <field name="ULCNR_LAT" length="9"/>
        <field name="ULCNR_LONG" length="10"/>
        <field name="ULCNR_HT" length="8"/>
        <field name="URCNR_LAT" length="9"/>
        <field name="URCNR_LONG" length="10"/>
        <field name="URCNR_HT" length="8"/>
        <field name="LRCNR_LAT" length="9"/>
        <field name="LRCNR_LONG" length="10"/>
        <field name="LRCNR_HT" length="8"/>
        <field name="LLCNR_LAT" length="9"/>
        <field name="LLCNR_LONG" length="10"/>
        <field name="LLCNR_HT" length="8"/>
    </tre>

    <tre name="CSEXRA" md_prefix="NITF_CSEXRA_" length="132" location="image">
        <field name="SENSOR" length="6"/>
        <field name="TIME_FIRST_LINE_IMAGE" length="12"/>
        <field name="TIME_IMAGE_DURATION" length="12"/>
        <field name="MAX_GSD" length="5"/>
        <field name="ALONG_SCAN_GSD" length="5"/>
        <field name="CROSS_SCAN_GSD" length="5"/>
        <field name="GEO_MEAN_GSD" length="5"/>
        <field name="A_S_VERT_GSD" length="5"/>
        <field name="C_S_VERT_GSD" length="5"/>
        <field name="GEO_MEAN_VERT_GSD" length="5"/>
        <field name="GSD_BETA_ANGLE" length="5"/>
        <field name="DYNAMIC_RANGE" length="5"/>
        <field name="NUM_LINES" length="7"/>
        <field name="NUM_SAMPLES" length="5"/>
        <field name="ANGLE_TO_NORTH" length="7"/>
        <field name="OBLIQUITY_ANGLE" length="6"/>
        <field name="AZ_OF_OBLIQUITY" length="7"/>
        <field name="GRD_COVER" length="1"/>
        <field name="SNOW_DEPTH_CAT" length="1"/>
        <field name="SUN_AZIMUTH" length="7"/>
        <field name="SUN_ELEVATION" length="7"/>
        <field name="PREDICTED_NIIRS" length="3"/>
        <field name="CIRCL_ERR" length="3"/>
        <field name="LINEAR_ERR" length="3"/>
    </tre>

    <tre name="CSPROA" length="120" location="image">
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field length="12"/>
        <field name="BWC" length="12"/>
    </tre>

    <tre name="CSSFAA" minlength="107" maxlength="425" location="image">
        <field name="NUM_BANDS" length="1"/>
        <loop counter="NUM_BANDS" md_prefix="BAND_%d_" name="BAND">
            <field name="BAND_TYPE" length="1"/>
            <field name="BAND_ID" length="6"/>
            <field name="FOC_LENGTH" length="11"/>
            <field name="NUM_DAP" length="8"/>
            <field name="NUM_FIR" length="8"/>
            <field name="DELTA" length="7"/>
            <field name="OPPOFF_X" length="7"/>
            <field name="OPPOFF_Y" length="7"/>
            <field name="OPPOFF_Z" length="7"/>
            <field name="START_X" length="11"/>
            <field name="START_Y" length="11"/>
            <field name="FINISH_X" length="11"/>
            <field name="FINISH_Y" length="11"/>
        </loop>
    </tre>

    <tre name="GEOLOB" length="48" location="image">
        <field name="ARV" length="9" type="real"/>
        <field name="BRV" length="9" type="real"/>
        <field name="LSO" length="15" type="real"/>
        <field name="PSO" length="15" type="real"/>
    </tre>

    <tre name="GEOPSB" length="443" location="file">
        <field name="TYP" length="3" type="string"/>
        <field name="UNI" length="3" type="string"/>
        <field name="DAG" length="80" type="string"/>
        <field name="DCD" length="4" type="string"/>
        <field name="ELL" length="80" type="string"/>
        <field name="ELC" length="3" type="string"/>
        <field name="DVR" length="80" type="string"/>
        <field name="VDCDVR" length="4" type="string"/>
        <field name="SDA" length="80" type="string"/>
        <field name="VDCSDA" length="4" type="string"/>
        <field name="ZOR" length="15" type="integer" minval="0"/>
        <field name="GRD" length="3" type="string"/>
        <field name="GRN" length="80" type="string"/>
        <field name="ZNA" length="4" type="integer" minval="0"/>
    </tre>

    <tre name="HISTOA" minlength="115" maxlength="83512" location="image">
        <field name="SYSTYPE" length="20"/>
        <field name="PC" length="12"/>
        <field name="PE" length="4"/>
        <field name="REMAP_FLAG" length="1"/>
        <field name="LUTID" length="2"/>
        <field name="NEVENTS" length="2"/>
        <loop counter="NEVENTS" md_prefix="EVENT_%02d_" name="EVENT">
            <field name="PDATE" length="14"/>
            <field name="PSITE" length="10"/>
            <field name="PAS" length="10"/>
            <field name="NIPCOM" length="1"/>
            <loop counter="NIPCOM" md_prefix="IPCOM_%d" name="IPCOM">
                <field name="" longname="IPCOM" length="80"/>
            </loop>
            <field name="IBPP" length="2"/>
            <field name="IPVTYPE" length="3"/>
            <field name="INBWC" length="10"/>
            <field name="DISP_FLAG" length="1"/>
            <field name="ROT_FLAG" length="1"/>
            <if cond="ROT_FLAG=1">
                <field name="ROT_ANGLE" length="8"/>
            </if>
            <field name="PROJ_FLAG" length="1"/>
            <field name="ASYM_FLAG" length="1"/>
            <if cond="ASYM_FLAG=1">
                <field name="ZOOMROW" length="7"/>
                <field name="ZOOMCOL" length="7"/>
            </if>
            <field name="SHARP_FLAG" length="1"/>
            <if cond="SHARP_FLAG=1">
                <field name="SHARPFAM" length="2"/>
                <field name="SHARPMEM" length="2"/>
            </if>
            <field name="MAG_FLAG" length="1"/>
            <if cond="MAG_FLAG=1">
                <field name="MAG_LEVEL" length="7"/>
            </if>
            <field name="DRA_FLAG" length="1"/>
            <if cond="DRA_FLAG=1">
                <field name="DRA_MULT" length="7"/>
                <field name="DRA_SUB" length="5"/>
            </if>
            <field name="TTC_FLAG" length="1"/>
            <if cond="TTC_FLAG=1">
                <field name="TTCFAM" length="2"/>
                <field name="TTCMEM" length="2"/>
            </if>
            <field name="DEVLUT_FLAG" length="1"/>
            <field name="OBPP" length="2"/>
            <field name="OPVTYPE" length="3"/>
            <field name="OUTBWC" length="10"/>
        </loop>
    </tre>

    <tre name="ICHIPB" length="224" location="image">
        <field name="XFRM_FLAG" length="2" type="integer"/>
        <field name="SCALE_FACTOR" length="10" type="real"/>
        <field name="ANAMRPH_CORR" length="2" type="integer"/>
        <field name="SCANBLK_NUM" length="2" type="integer"/>
        <field name="OP_ROW_11" length="12" type="real"/>
        <field name="OP_COL_11" length="12" type="real"/>
        <field name="OP_ROW_12" length="12" type="real"/>
        <field name="OP_COL_12" length="12" type="real"/>
        <field name="OP_ROW_21" length="12" type="real"/>
        <field name="OP_COL_21" length="12" type="real"/>
        <field name="OP_ROW_22" length="12" type="real"/>
        <field name="OP_COL_22" length="12" type="real"/>
        <field name="FI_ROW_11" length="12" type="real"/>
        <field name="FI_COL_11" length="12" type="real"/>
        <field name="FI_ROW_12" length="12" type="real"/>
        <field name="FI_COL_12" length="12" type="real"/>
        <field name="FI_ROW_21" length="12" type="real"/>
        <field name="FI_COL_21" length="12" type="real"/>
        <field name="FI_ROW_22" length="12" type="real"/>
        <field name="FI_COL_22" length="12" type="real"/>
        <field name="FI_ROW" length="8" type="integer"/>
        <field name="FI_COL" length="8" type="integer"/>
    </tre>

    <tre name="J2KLRA" location="image">
        <field name="ORIG" length="1"/>
        <field name="NLEVELS_O" length="2"/>
        <field name="NBANDS_O" length="5"/>
        <field name="NLAYERS_O" length="3"/>
        <loop counter="NLAYERS_O" md_prefix="LAYER_%03d_" name="LAYER">
            <field name="LAYER_ID" length="3"/>
            <field name="BITRATE" length="9"/>
        </loop>
        <if_remaining_bytes>
            <field name="NLEVELS_I" length="2"/>
            <field name="NBANDS_I" length="5"/>
            <field name="NLAYERS_I" length="3"/>
        </if_remaining_bytes>
    </tre>

    <tre name="MAPLOB" length="43" location="image">
        <field name="UNILOA" length="3" type="string"/>
        <field name="LOD" length="5" type="integer" minval="1" maxval="99999"/>
        <field name="LAD" length="5" type="integer" minval="1" maxval="99999"/>
        <field name="LSO" length="15" type="real"/>
        <field name="PSO" length="15" type="real"/>
    </tre>

    <tre name="PIAIMB" md_prefix="NITF_PIAIMB_" length="337" location="image">
        <field name="CLOUDCVR" length="3"/>
        <field name="SRP" length="1"/>
        <field name="SENSMODE" length="12"/>
        <field name="SENSNAME" length="18"/>
        <field name="SOURCE" length="255"/>
        <field name="COMGEN" length="2"/>
        <field name="SUBQUAL" length="1"/>
        <field name="PIAMSNNUM" length="7"/>
        <field name="CAMSPECS" length="32"/>
        <field name="PROJID" length="2"/>
        <field name="GENERATION" length="1"/>
        <field name="ESD" length="1"/>
        <field name="OTHERCOND" length="2"/>
    </tre>

    <tre name="PIAIMC" md_prefix="NITF_PIAIMC_" length="362" location="image">
        <field name="CLOUDCVR" length="3"/>
        <field name="SRP" length="1"/>
        <field name="SENSMODE" length="12"/>
        <field name="SENSNAME" length="18"/>
        <field name="SOURCE" length="255"/>
        <field name="COMGEN" length="2"/>
        <field name="SUBQUAL" length="1"/>
        <field name="PIAMSNNUM" length="7"/>
        <field name="CAMSPECS" length="32"/>
        <field name="PROJID" length="2"/>
        <field name="GENERATION" length="1"/>
        <field name="ESD" length="1"/>
        <field name="OTHERCOND" length="2"/>
        <field name="MEANGSD" length="7"/>
        <field name="IDATUM" length="3"/>
        <field name="IELLIP" length="3"/>
        <field name="PREPROC" length="2"/>
        <field name="IPROJ" length="2"/>
        <field name="SATTRACK" length="8"/>
    </tre>

    <tre name="PIAPEA" length="92" location="image">
        <field name="LASTNME" length="28" type="string"/>
        <field name="FIRSTNME" length="28" type="string"/>
        <field name="MIDNME" length="28" type="string"/>
        <field name="DOB" length="6" type="string"/>
        <field name="ASSOCTRY" length="2" type="string"/>
    </tre>

    <tre name="PIAPRC" minlength="201" maxlength="63759" location="file"> <!-- same as PIAPRD apparently ? -->
        <field name="ACCESSID" length="64" type="string"/>
        <field name="FMCONTROL" length="32" type="string"/>
        <field name="SUBDET" length="1" type="string"/>
        <field name="PRODCODE" length="2" type="string"/>
        <field name="PRODUCERSE" length="6" type="string"/>
        <field name="PRODIDNO" length="20" type="string"/>
        <field name="PRODSNME" length="10" type="string"/>
        <field name="PRODUCERCD" length="2" type="string"/>
        <field name="PRODCRTIME" length="14" type="string"/>
        <field name="MAPID" length="40" type="string"/>
        <field name="SECTITLEREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="SECTITLEREP" md_prefix="SECTITLE_%02d_" name="SECTITLE">
            <field name="SECTITLE" length="40" type="string"/>
            <field name="PPNUM" length="5" type="string"/>
            <field name="TPP" length="3" type="integer" minval="1" maxval="999"/>
        </loop>
        <field name="REQORGREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="REQORGREP" md_prefix="REQORG_%02d" name="REQORG">
            <field name="" longname="REQORG" length="64" type="string"/>
        </loop>
        <field name="KEYWORDREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="KEYWORDREP" md_prefix="KEYWORD_%02d" name="KEYWORD">
            <field name="" longname="KEYWORD" length="255" type="string"/>
        </loop>
        <field name="ASSRPTREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="ASSRPTREP" md_prefix="ASSRPT_%02d" name="ASSRPT">
            <field name="" longname="ASSRPT" length="20" type="string"/>
        </loop>
        <field name="ATEXTREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="ATEXTREP" md_prefix="ATEXT_%02d" name="ATEXT">
            <field name="" longname="ATEXT" length="255" type="string"/>
        </loop>
    </tre>

    <tre name="PIAPRD" minlength="201" maxlength="63759" location="image">
        <field name="ACCESSID" length="64" type="string"/>
        <field name="FMCONTROL" length="32" type="string"/>
        <field name="SUBDET" length="1" type="string"/>
        <field name="PRODCODE" length="2" type="string"/>
        <field name="PRODUCERSE" length="6" type="string"/>
        <field name="PRODIDNO" length="20" type="string"/>
        <field name="PRODSNME" length="10" type="string"/>
        <field name="PRODUCERCD" length="2" type="string"/>
        <field name="PRODCRTIME" length="14" type="string"/>
        <field name="MAPID" length="40" type="string"/>
        <field name="SECTITLEREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="SECTITLEREP" md_prefix="SECTITLE_%02d_" name="SECTITLE">
            <field name="SECTITLE" length="40" type="string"/>
            <field name="PPNUM" length="5" type="string"/>
            <field name="TPP" length="3" type="integer" minval="1" maxval="999"/>
        </loop>
        <field name="REQORGREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="REQORGREP" md_prefix="REQORG_%02d" name="REQORG">
            <field name="" longname="REQORG" length="64" type="string"/>
        </loop>
        <field name="KEYWORDREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="KEYWORDREP" md_prefix="KEYWORD_%02d" name="KEYWORD">
            <field name="" longname="KEYWORD" length="255" type="string"/>
        </loop>
        <field name="ASSRPTREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="ASSRPTREP" md_prefix="ASSRPT_%02d" name="ASSRPT">
            <field name="" longname="ASSRPT" length="20" type="string"/>
        </loop>
        <field name="ATEXTREP" length="2" type="integer" minval="0" maxval="99"/>
        <loop counter="ATEXTREP" md_prefix="ATEXT_%02d" name="ATEXT">
            <field name="" longname="ATEXT" length="255" type="string"/>
        </loop>
    </tre>

    <tre name="PRJPSB" minlength="113" maxlength="248" location="file">
        <field name="PRN" length="80" type="string"/>
        <field name="PCO" length="2" type="string"/>
        <field name="NUM_PRJ" length="1" type="integer" minval="0" maxval="9"/>
        <loop counter="NUM_PRJ" md_prefix="PRJ%d" name="PRJ">
            <field name="" longname="PRJ" length="15" type="string"/>
        </loop>
        <field name="XOR" length="15" type="integer" minval="0"/>
        <field name="YOR" length="15" type="integer" minval="0"/>
    </tre>

    <!-- RPC00A and RPC00B differ by the order of coefficients. See NITFReadRPC00B() -->
    <tre name="RPC00A" length="1041" location="image">
        <field name="SUCCESS" length="1" type="string" fixed_value="1"/>
        <field name="ERR_BIAS" length="7" unit="meters" type="real" minval="0000.00" maxval="9999.99"/>
        <field name="ERR_RAND" length="7" unit="meters" type="real" minval="0000.00" maxval="9999.99"/>
        <field name="LINE_OFF" length="6" unit="pixels" type="integer"/>
        <field name="SAMP_OFF" length="5" unit="pixels" type="integer"/>
        <field name="LAT_OFF" length="8" unit="degrees" type="real" minval="-90.0" maxval="90.0"/>
        <field name="LONG_OFF" length="9" unit="degrees" type="real" minval="-180.0" maxval="180.0"/>
        <field name="HEIGHT_OFF" length="5" unit="meters" type="integer" minval="-9999" maxval="9999"/>
        <field name="LINE_SCALE" length="6" unit="pixels" type="integer" minval="1" maxval="999999"/>
        <field name="SAMP_SCALE" length="5" unit="pixels" type="integer" minval="1" maxval="99999"/>
        <field name="LAT_SCALE" length="8" unit="degrees" type="real" minval="-90.0" maxval="90.0"/>
        <field name="LONG_SCALE" length="9" unit="degrees" type="real" minval="-180.0" maxval="180.0"/>
        <field name="HEIGHT_SCALE" length="5" unit="meters" type="integer" minval="-9999" maxval="9999"/>
        <loop iterations="20" md_prefix="LINE_NUM_COEFF_%02d" name="LINE_NUM_COEFF">
            <field name="" longname="LINE_NUM_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="LINE_DEN_COEFF_%02d" name="LINE_DEN_COEFF">
            <field name="" longname="LINE_DEN_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="SAMP_NUM_COEFF_%02d" name="SAMP_NUM_COEFF">
            <field name="" longname="SAMP_NUM_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="SAMP_DEN_COEFF_%02d" name="SAMP_DEN_COEFF">
            <field name="" longname="SAMP_DEN_COEFF" length="12" type="real"/>
        </loop>
    </tre>

    <tre name="RPC00B" length="1041" location="image">
        <field name="SUCCESS" length="1" type="string" fixed_value="1"/>
        <field name="ERR_BIAS" length="7" unit="meters" type="real" minval="0000.00" maxval="9999.99"/>
        <field name="ERR_RAND" length="7" unit="meters" type="real" minval="0000.00" maxval="9999.99"/>
        <field name="LINE_OFF" length="6" unit="pixels" type="integer"/>
        <field name="SAMP_OFF" length="5" unit="pixels" type="integer"/>
        <field name="LAT_OFF" length="8" unit="degrees" type="real" minval="-90.0" maxval="90.0"/>
        <field name="LONG_OFF" length="9" unit="degrees" type="real" minval="-180.0" maxval="180.0"/>
        <field name="HEIGHT_OFF" length="5" unit="meters" type="integer" minval="-9999" maxval="9999"/>
        <field name="LINE_SCALE" length="6" unit="pixels" type="integer" minval="1" maxval="999999"/>
        <field name="SAMP_SCALE" length="5" unit="pixels" type="integer" minval="1" maxval="99999"/>
        <field name="LAT_SCALE" length="8" unit="degrees" type="real" minval="-90.0" maxval="90.0"/>
        <field name="LONG_SCALE" length="9" unit="degrees" type="real" minval="-180.0" maxval="180.0"/>
        <field name="HEIGHT_SCALE" length="5" unit="meters" type="integer" minval="-9999" maxval="9999"/>
        <loop iterations="20" md_prefix="LINE_NUM_COEFF_%02d" name="LINE_NUM_COEFF">
            <field name="" longname="LINE_NUM_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="LINE_DEN_COEFF_%02d" name="LINE_DEN_COEFF">
            <field name="" longname="LINE_DEN_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="SAMP_NUM_COEFF_%02d" name="SAMP_NUM_COEFF">
            <field name="" longname="SAMP_NUM_COEFF" length="12" type="real"/>
        </loop>
        <loop iterations="20" md_prefix="SAMP_DEN_COEFF_%02d" name="SAMP_DEN_COEFF">
            <field name="" longname="SAMP_DEN_COEFF" length="12" type="real"/>
        </loop>
    </tre>

    <tre name="RSMAPA" minlength="507" maxlength="1243" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="TID" length="40" type="string"/>
        <field name="NPAR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="XUOL" length="21" type="real" unit="meters"/>
        <field name="YUOL" length="21" type="real" unit="meters"/>
        <field name="ZUOL" length="21" type="real" unit="meters"/>
        <field name="XUXL" length="21" type="real"/>
        <field name="XUYL" length="21" type="real"/>
        <field name="XUZL" length="21" type="real"/>
        <field name="YUXL" length="21" type="real"/>
        <field name="YUYL" length="21" type="real"/>
        <field name="YUZL" length="21" type="real"/>
        <field name="ZUXL" length="21" type="real"/>
        <field name="ZUYL" length="21" type="real"/>
        <field name="ZUZL" length="21" type="real"/>
        <field name="IRO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRZZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IC0" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICZZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GS" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZZ" length="2" type="integer" minval="1" maxval="36"/>
        <loop counter="NPAR" md_prefix="PAR_%02d_" name="PAR">
            <field name="PARVAL" length="21" type="real"/>
        </loop>
    </tre>

    <tre name="RSMDCA" minlength="597" maxlength="99988" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="TID" length="40" type="string"/>
        <field name="NPAR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="NIMGE" length="3" type="integer" minval="1" maxval="999"/>
        <field name="NPART" length="5" type="integer" minval="1" maxval="99999"/>
        <loop counter="NIMGE" md_prefix="IMAGEF_%03d_" name="IMAGE">
            <field name="IID" length="80" type="string"/>
            <field name="NPARI" length="2" type="integer" minval="1" maxval="36"/>
        </loop>
        <field name="XUOL" length="21" type="real" unit="meters"/>
        <field name="YUOL" length="21" type="real" unit="meters"/>
        <field name="ZUOL" length="21" type="real" unit="meters"/>
        <field name="XUXL" length="21" type="real"/>
        <field name="XUYL" length="21" type="real"/>
        <field name="XUZL" length="21" type="real"/>
        <field name="YUXL" length="21" type="real"/>
        <field name="YUYL" length="21" type="real"/>
        <field name="YUZL" length="21" type="real"/>
        <field name="ZUXL" length="21" type="real"/>
        <field name="ZUYL" length="21" type="real"/>
        <field name="ZUZL" length="21" type="real"/>
        <field name="IRO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IRZZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="IC0" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="ICZZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZO" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZR" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GS" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GXZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GYZ" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZX" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZY" length="2" type="integer" minval="1" maxval="36"/>
        <field name="GZZ" length="2" type="integer" minval="1" maxval="36"/>
        <loop formula="(NPART+1)*(NPART)/2" name="DERCOV" md_prefix="DERCOV_%05d"> <!--Warning: this condition is currently hardcoded in the interpreter -->
            <field name="" longname="DERCOV" length="21" type="real"/>
        </loop>
    </tre>

    <tre name="RSMECA" minlength="354" maxlength="42864" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="TID" length="40" type="string"/>
        <field name="INCLIC" length="1" type="string"/>
        <field name="INCLUC" length="1" type="string"/>
        <if cond="INCLIC=Y">
            <field name="NPAR" length="2" type="integer" minval="1" maxval="36"/>
            <field name="NPARO" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IGN" length="2" type="integer" minval="1" maxval="36"/>
            <field name="CVDATE" length="8" type="string"/>
            <field name="XUOL" length="21" type="real" unit="meters"/>
            <field name="YUOL" length="21" type="real" unit="meters"/>
            <field name="ZUOL" length="21" type="real" unit="meters"/>
            <field name="XUXL" length="21" type="real"/>
            <field name="XUYL" length="21" type="real"/>
            <field name="XUZL" length="21" type="real"/>
            <field name="YUXL" length="21" type="real"/>
            <field name="YUYL" length="21" type="real"/>
            <field name="YUZL" length="21" type="real"/>
            <field name="ZUXL" length="21" type="real"/>
            <field name="ZUYL" length="21" type="real"/>
            <field name="ZUZL" length="21" type="real"/>
            <field name="IRO" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRXX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRXY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRXZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRYY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRYZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IRZZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="IC0" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICXX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICXY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICXZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICYY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICYZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="ICZZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GXO" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GYO" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GZO" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GXR" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GYR" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GZR" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GS" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GXX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GXY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GXZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GYX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GYY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GYZ" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GZX" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GZY" length="2" type="integer" minval="1" maxval="36"/>
            <field name="GZZ" length="2" type="integer" minval="1" maxval="36"/>
            <loop counter="IGN" name="IG" md_prefix="IG_%02d_">
                <field name="NUMOPG" length="2" type="integer" minval="1" maxval="36"/>
                <loop formula="(NUMOPG+1)*(NUMOPG)/2" name="EG" md_prefix="EG_%02d"> <!--Warning: this condition is currently hardcoded in the interpreter -->
                    <field name="" longname="ERRCVG" length="21" type="real"/>
                </loop>
                <field name="TCDF" length="1" type="integer" minval="0" maxval="2"/>
                <field name="NCSEG" length="1" type="integer" minval="2" maxval="9"/>
                <loop counter="NCSEG" name="CORSEG" md_prefix="CORSEG_%d_">
                    <field name="CORSEG" length="21" type="real"/>
                    <field name="TAUSEG" length="21" type="real" unit="seconds"/>
                </loop>
            </loop>
            <loop formula="NPAR*NPARO" name="MAP" md_prefix="MAP_%04d"> <!--Warning: this condition is currently hardcoded in the interpreter -->
                <field name="" longname="MAP" length="21" type="real"/>
            </loop>
        </if>
        <if cond="INCLUC=Y">
            <field name="URR" length="21" type="real" unit="pixel^2"/>
            <field name="URC" length="21" type="real" unit="pixel^2"/>
            <field name="UCC" length="21" type="real" unit="pixel^2"/>
            <field name="UNCSR" length="1" type="integer" minval="2" maxval="9"/>
            <loop counter="UNCSR" name="CORSR" md_prefix="CORSR_%d_">
                <field name="UCORSR" length="21" type="real"/>
                <field name="UTAUSR" length="21" type="real" unit="pixels"/>
            </loop>
            <field name="UNCSC" length="1" type="integer" minval="2" maxval="9"/>
            <loop counter="UNCSC" name="CORSC" md_prefix="CORSC_%d_">
                <field name="UCORSC" length="21" type="real"/>
                <field name="UTAUSC" length="21" type="real" unit="pixels"/>
            </loop>
        </if>
    </tre>

    <tre name="RSMGGA" minlength="390" maxlength="99988" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="GGRSN" length="3" type="integer" minval="1" maxval="256"/>
        <field name="GGCSN" length="3" type="integer" minval="1" maxval="256"/>
        <field name="GGRFEP" length="21" type="real"/>
        <field name="GGCFEP" length="21" type="real"/>
        <field name="INTORD" length="1" type="integer" minval="0" maxval="3"/>
        <field name="NPLN" length="3" type="integer" minval="2" maxval="999"/>
        <field name="DELTAZ" length="21" type="real"/>
        <field name="DELTAX" length="21" type="real"/>
        <field name="DELTAY" length="21" type="real"/>
        <field name="ZPLN1" length="21" type="real"/>
        <field name="XIPLN1" length="21" type="real"/>
        <field name="YIPLN1" length="21" type="real"/>
        <field name="REFROW" length="9" type="integer"/>
        <field name="REFCOL" length="9" type="integer"/>
        <field name="TNUMRD" length="2" type="integer" minval="3" maxval="31"/>
        <field name="TNUMCD" length="2" type="integer" minval="3" maxval="31"/>
        <field name="FNUMRD" length="1" type="integer" minval="1" maxval="3"/>
        <field name="FNUMCD" length="1" type="integer" minval="1" maxval="3"/>
        <loop formula="NPLN-1" name="IG" md_prefix="IG_%03d_"> <!--Warning: this condition is currently hardcoded in the interpreter -->
            <field name="IXO" length="4" type="integer"/>
            <field name="IYO" length="4" type="integer"/>
        </loop>
        <loop counter="NPLN" name="GP" md_prefix="GP_%03d_">
            <field name="NXPTS" length="3" type="integer" minval="2"/>
            <field name="NYPTS" length="3" type="integer" minval="2"/>
            <loop formula="NXPTS*NYPTS" name="GPCOORD" md_prefix="GPCOORD_%06d_"> <!--Warning: this condition is currently hardcoded in the interpreter -->
                <field name="RCOORD" length_var="TNUMRD" type="integer"/>
                <field name="CCOORD" length_var="TNUMCD" type="integer"/>
            </loop>
        </loop>
    </tre>

    <tre name="RSMGIA" length="591" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="GR0" length="21" type="real"/>
        <field name="GRX" length="21" type="real"/>
        <field name="GRY" length="21" type="real"/>
        <field name="GRZ" length="21" type="real"/>
        <field name="GRXX" length="21" type="real"/>
        <field name="GRXY" length="21" type="real"/>
        <field name="GRXZ" length="21" type="real"/>
        <field name="GRYY" length="21" type="real"/>
        <field name="GRYZ" length="21" type="real"/>
        <field name="GRZZ" length="21" type="real"/>
        <field name="GC0" length="21" type="real"/>
        <field name="GCX" length="21" type="real"/>
        <field name="GCY" length="21" type="real"/>
        <field name="GCZ" length="21" type="real"/>
        <field name="GCXX" length="21" type="real"/>
        <field name="GCXY" length="21" type="real"/>
        <field name="GCXZ" length="21" type="real"/>
        <field name="GCYY" length="21" type="real"/>
        <field name="GCYZ" length="21" type="real"/>
        <field name="GCZZ" length="21" type="real"/>
        <field name="GRNIS" length="3" type="integer"/>
        <field name="GCNIS" length="3" type="integer"/>
        <field name="GTNIS" length="3" type="integer"/>
        <field name="GRSSIZ" length="21" type="real"/>
        <field name="GCSSIZ" length="21" type="real"/>
    </tre>

    <tre name="RSMIDA" length="1628" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="ISID" length="40" type="string"/>
        <field name="SID" length="40" type="string"/>
        <field name="STID" length="40" type="string"/>
        <field name="YEAR" length="4" type="integer"/>
        <field name="MONTH" length="2" type="integer"/>
        <field name="DAY" length="2" type="integer"/>
        <field name="HOUR" length="2" type="integer"/>
        <field name="MINUTE" length="2" type="integer"/>
        <field name="SECOND" length="9" type="real"/>
        <field name="NRG" length="8" type="integer" unit="pixels" minval="1" maxval="99999999"/>
        <field name="NCG" length="8" type="integer" unit="pixels" minval="1" maxval="99999999"/>
        <field name="TRG" length="21" type="real" unit="seconds"/>
        <field name="TCG" length="21" type="real" unit="seconds"/>
        <field name="GRNDD" length="1" type="string"/>
        <field name="XUOR" length="21" type="real" unit="meters"/>
        <field name="YUOR" length="21" type="real" unit="meters"/>
        <field name="ZUOR" length="21" type="real" unit="meters"/>
        <field name="XUXR" length="21" type="real"/>
        <field name="XUYR" length="21" type="real"/>
        <field name="XUZR" length="21" type="real"/>
        <field name="YUXR" length="21" type="real"/>
        <field name="YUYR" length="21" type="real"/>
        <field name="YUZR" length="21" type="real"/>
        <field name="ZUXR" length="21" type="real"/>
        <field name="ZUYR" length="21" type="real"/>
        <field name="ZUZR" length="21" type="real"/>
        <field name="V1X" length="21" type="real"/>
        <field name="V1Y" length="21" type="real"/>
        <field name="V1Z" length="21" type="real"/>
        <field name="V2X" length="21" type="real"/>
        <field name="V2Y" length="21" type="real"/>
        <field name="V2Z" length="21" type="real"/>
        <field name="V3X" length="21" type="real"/>
        <field name="V3Y" length="21" type="real"/>
        <field name="V3Z" length="21" type="real"/>
        <field name="V4X" length="21" type="real"/>
        <field name="V4Y" length="21" type="real"/>
        <field name="V4Z" length="21" type="real"/>
        <field name="V5X" length="21" type="real"/>
        <field name="V5Y" length="21" type="real"/>
        <field name="V5Z" length="21" type="real"/>
        <field name="V6X" length="21" type="real"/>
        <field name="V6Y" length="21" type="real"/>
        <field name="V6Z" length="21" type="real"/>
        <field name="V7X" length="21" type="real"/>
        <field name="V7Y" length="21" type="real"/>
        <field name="V7Z" length="21" type="real"/>
        <field name="V8X" length="21" type="real"/>
        <field name="V8Y" length="21" type="real"/>
        <field name="V8Z" length="21" type="real"/>
        <field name="GRPX" length="21" type="real"/>
        <field name="GRPY" length="21" type="real"/>
        <field name="GRPZ" length="21" type="real"/>
        <field name="FULLR" length="8" type="integer" unit="pixels" minval="1" maxval="99999999"/>
        <field name="FULLC" length="8" type="integer" unit="pixels" minval="1" maxval="99999999"/>
        <field name="MINR" length="8" type="integer" unit="pixels" minval="0" maxval="99999999"/>
        <field name="MAXR" length="8" type="integer" unit="pixels" minval="0" maxval="99999999"/>
        <field name="MINC" length="8" type="integer" unit="pixels" minval="0" maxval="99999999"/>
        <field name="MAXC" length="8" type="integer" unit="pixels" minval="0" maxval="99999999"/>
        <field name="IE0" length="21" type="real" unit="radians"/>
        <field name="IER" length="21" type="real"/>
        <field name="IEC" length="21" type="real"/>
        <field name="IERR" length="21" type="real"/>
        <field name="IERC" length="21" type="real"/>
        <field name="IECC" length="21" type="real"/>
        <field name="IA0" length="21" type="real" unit="radians"/>
        <field name="IAR" length="21" type="real"/>
        <field name="IAC" length="21" type="real"/>
        <field name="IARR" length="21" type="real"/>
        <field name="IARC" length="21" type="real"/>
        <field name="IACC" length="21" type="real"/>
        <field name="SPX" length="21" type="real"/>
        <field name="SVX" length="21" type="real"/>
        <field name="SAX" length="21" type="real"/>
        <field name="SPY" length="21" type="real"/>
        <field name="SVY" length="21" type="real"/>
        <field name="SAY" length="21" type="real"/>
        <field name="SPZ" length="21" type="real"/>
        <field name="SVZ" length="21" type="real"/>
        <field name="SAZ" length="21" type="real"/>
    </tre>

    <tre name="RSMPCA" minlength="486" maxlength="18546" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="RSN" length="3" type="integer" minval="1" maxval="256"/>
        <field name="CSN" length="3" type="integer" minval="1" maxval="256"/>
        <field name="RFEP" length="21" type="real"/>
        <field name="CFEP" length="21" type="real"/>
        <field name="RNRMO" length="21" type="real"/>
        <field name="CNRMO" length="21" type="real"/>
        <field name="XNRMO" length="21" type="real"/>
        <field name="YNRMO" length="21" type="real"/>
        <field name="ZNRMO" length="21" type="real"/>
        <field name="RNRMSF" length="21" type="real"/>
        <field name="CNRMSF" length="21" type="real"/>
        <field name="XNRMSF" length="21" type="real"/>
        <field name="YNRMSF" length="21" type="real"/>
        <field name="ZNRMSF" length="21" type="real"/>
        <field name="RNPWRX" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RNPWRY" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RNPWRZ" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RNTRMS" length="3" type="integer" minval="1" maxval="216"/>
        <loop counter="RNTRMS" name="RNPCF" md_prefix="RNPCF_%03d">
            <field name="" longname="RNPCF" length="21" type="real"/>
        </loop>
        <field name="RDPWRX" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RDPWRY" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RDPWRZ" length="1" type="integer" minval="0" maxval="5"/>
        <field name="RDTRMS" length="3" type="integer" minval="1" maxval="216"/>
        <loop counter="RDTRMS" name="RDPCF" md_prefix="RDPCF_%03d">
            <field name="" longname="RDPCF" length="21" type="real"/>
        </loop>
        <field name="CNPWRX" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CNPWRY" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CNPWRZ" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CNTRMS" length="3" type="integer" minval="1" maxval="216"/>
        <loop counter="CNTRMS" name="CNPCF" md_prefix="CNPCF_%03d">
            <field name="" longname="CNPCF" length="21" type="real"/>
        </loop>
        <field name="CDPWRX" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CDPWRY" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CDPWRZ" length="1" type="integer" minval="0" maxval="5"/>
        <field name="CDTRMS" length="3" type="integer" minval="1" maxval="216"/>
        <loop counter="CDTRMS" name="CDPCF" md_prefix="CDPCF_%03d">
            <field name="" longname="CDPCF" length="21" type="real"/>
        </loop>
    </tre>

    <tre name="RSMPIA" length="591" location="image">
        <field name="IID" length="80" type="string"/>
        <field name="EDITION" length="40" type="string"/>
        <field name="R0" length="21" type="real"/>
        <field name="RX" length="21" type="real"/>
        <field name="RY" length="21" type="real"/>
        <field name="RZ" length="21" type="real"/>
        <field name="RXX" length="21" type="real"/>
        <field name="RXY" length="21" type="real"/>
        <field name="RXZ" length="21" type="real"/>
        <field name="RYY" length="21" type="real"/>
        <field name="RYZ" length="21" type="real"/>
        <field name="RZZ" length="21" type="real"/>
        <field name="C0" length="21" type="real"/>
        <field name="CX" length="21" type="real"/>
        <field name="CY" length="21" type="real"/>
        <field name="CZ" length="21" type="real"/>
        <field name="CXX" length="21" type="real"/>
        <field name="CXY" length="21" type="real"/>
        <field name="CXZ" length="21" type="real"/>
        <field name="CYY" length="21" type="real"/>
        <field name="CYZ" length="21" type="real"/>
        <field name="CZZ" length="21" type="real"/>
        <field name="RNIS" length="3" type="integer"/>
        <field name="CNIS" length="3" type="integer"/>
        <field name="TNIS" length="3" type="integer"/>
        <field name="RSSIZ" length="21" type="real"/>
        <field name="CSSIZ" length="21" type="real"/>
    </tre>

    <tre name="SOURCB" minlength="906" maxlength="99985" location="image">
        <field name="IS_SCA" length="9" type="integer"/>
        <field name="CPATCH" length="10" type="string"/>
        <field name="NUM_SOUR" length="2" type="integer" minval="1"/>
        <loop counter="NUM_SOUR" name="SOURCE" md_prefix="SOURCE_%02d_">
            <field name="NUM_BP" length="2" type="integer"/>
            <loop counter="NUM_BP" name="BP" md_prefix="BP_%02d_">
                <field name="NUM_PTS" length="3" type="integer"/>
                <loop counter="NUM_PTS" md_prefix="POINT_%03d_" name="POINT">
                    <field name="LON" length="15" type="real"/>
                    <field name="LAT" length="15" type="real"/>
                </loop>
            </loop>
            <field name="PRT" length="10" type="string"/>
            <field name="URF" length="20" type="string"/>
            <field name="EDN" length="7" type="string"/>
            <field name="NAM" length="20" type="string"/>
            <field name="CDP" length="3" type="integer"/>
            <field name="CDV" length="8" type="string"/>
            <field name="CDV27" length="8" type="string"/>
            <field name="SRN" length="80" type="string"/>
            <field name="SCA" length="9" type="integer"/>
            <field name="UNISQU" length="3" type="string"/>
            <if cond="UNISQU!=">
                <field name="SQU" length="10" type="integer"/>
            </if>
            <field name="UNIPCI" length="3" type="string"/>
            <if cond="UNIPCI!=">
                <field name="PCI" length="4" type="integer"/>
            </if>
            <field name="WPC" length="3" type="integer"/>
            <field name="NST" length="3" type="integer"/>
            <field name="UNIHKE" length="3" type="string"/>
            <if cond="UNIHKE!=">
                <field name="HKE" length="6" type="integer"/>
                <field name="LONHKE" length="15" type="real"/>
                <field name="LATHKE" length="15" type="real"/>
            </if>
            <field name="QSS" length="1" type="string"/>
            <field name="QOD" length="1" type="string"/>
            <if cond="QSS!=U AND QOD!=Y">                           <!--Warning: this condition is currently hardcoded in the interpreter -->
                <field name="CDV10" length="8" type="string"/>
            </if>
            <field name="QLE" length="80" type="string"/>
            <field name="CPY" length="80" type="string"/>
            <field name="NMI" length="2" type="integer"/>
            <loop counter="NMI" name="MI" md_prefix="MI_%02d_">
                <field name="CDV30" length="8" type="string"/>
                <field name="UNIRAT" length="3" type="string"/>
                <field name="RAT" length="8" type="real"/>
                <field name="UNIGMA" length="3" type="string"/>
                <field name="GMA" length="8" type="real"/>
                <field name="LONGMA" length="15" type="real"/>
                <field name="LATGMA" length="15" type="real"/>
                <field name="UNIGCA" length="3" type="string"/>
                <if cond="UNIGCA!=">
                    <field name="GCA" length="8" type="real"/>
                </if>
            </loop>
            <field name="NLI" length="2" type="integer"/>
            <loop counter="NLI" name="LI" md_prefix="LI_%02d_">
                <field name="BAD" length="10" type="string"/>
            </loop>
            <field name="DAG" length="80" type="string"/>
            <field name="DCD" length="4" type="string"/>
            <field name="ELL" length="80" type="string"/>
            <field name="ELC" length="3" type="string"/>
            <field name="DVR" length="80" type="string"/>
            <field name="VDCDVR" length="4" type="string"/>
            <field name="SDA" length="80" type="string"/>
            <field name="VDCSDA" length="4" type="string"/>
            <field name="PRN" length="80" type="string"/>
            <field name="PCO" length="2" type="string"/>
            <field name="NUM_PRJ" length="1" type="integer"/>
            <loop counter="NUM_PRJ" name="PRJ" md_prefix="PRJ_%d">
                <field name="" longname="PRJ" length="15" type="real"/>
            </loop>
            <field name="XOR" length="15" type="integer" minval="0"/>
            <field name="YOR" length="15" type="integer" minval="0"/>
            <field name="GRD" length="3" type="string"/>
            <field name="GRN" length="80" type="string"/>
            <field name="ZNA" length="4" type="integer" minval="0"/>
            <field name="NIN" length="2" type="integer"/>
            <loop counter="NIN" name="IN" md_prefix="IN_%02d_">
                <field name="INT" length="10" type="string"/>
                <field name="INS_SCA" length="9" type="integer"/>
                <field name="NTL" length="15" type="real"/>
                <field name="TTL" length="15" type="real"/>
                <field name="NVL" length="15" type="real"/>
                <field name="TVL" length="15" type="real"/>
                <field name="NTR" length="15" type="real"/>
                <field name="TTR" length="15" type="real"/>
                <field name="NVR" length="15" type="real"/>
                <field name="TVR" length="15" type="real"/>
                <field name="NRL" length="15" type="real"/>
                <field name="TRL" length="15" type="real"/>
                <field name="NSL" length="15" type="real"/>
                <field name="TSL" length="15" type="real"/>
                <field name="NRR" length="15" type="real"/>
                <field name="TRR" length="15" type="real"/>
                <field name="NSR" length="15" type="real"/>
                <field name="TSR" length="15" type="real"/>
            </loop>
        </loop>
    </tre>

    <tre name="STDIDC" md_prefix="NITF_STDIDC_" length="89" location="image">
        <field name="ACQUISITION_DATE" length="14"/>
        <field name="MISSION" length="14"/>
        <field name="PASS" length="2"/>
        <field name="OP_NUM" length="3"/>
        <field name="START_SEGMENT" length="2"/>
        <field name="REPRO_NUM" length="2"/>
        <field name="REPLAY_REGEN" length="3"/>
        <field length="1"/>
        <field name="START_COLUMN" length="3"/>
        <field name="START_ROW" length="5"/>
        <field name="END_SEGMENT" length="2"/>
        <field name="END_COLUMN" length="3"/>
        <field name="END_ROW" length="5"/>
        <field name="COUNTRY" length="2"/>
        <field name="WAC" length="4"/>
        <field name="LOCATION" length="11"/>
        <field length="5"/>
        <field length="8"/>
    </tre>

    <tre name="USE00A" md_prefix="NITF_USE00A_" length="107" location="image">
        <field name="ANGLE_TO_NORTH" length="3"/>
        <field name="MEAN_GSD" length="5"/>
        <field length="1"/>
        <field name="DYNAMIC_RANGE" length="5"/>
        <field length="3"/>
        <field length="1"/>
        <field length="3"/>
        <field name="OBL_ANG" length="5"/>
        <field name="ROLL_ANG" length="6"/>
        <field length="12"/>
        <field length="15"/>
        <field length="4"/>
        <field length="1"/>
        <field length="3"/>
        <field length="1"/>
        <field length="1"/>
        <field name="N_REF" length="2"/>
        <field name="REV_NUM" length="5"/>
        <field name="N_SEG" length="3"/>
        <field name="MAX_LP_SEG" length="6"/>
        <field length="6"/>
        <field length="6"/>
        <field name="SUN_EL" length="5"/>
        <field name="SUN_AZ" length="5"/>
    </tre>
</tres>
