<?xml version="1.0"?>
<!--
/******************************************************************************
 * $Id: nitf_spec.xml 35539 2016-09-29 12:18:43Z 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" fixed_value="                "/>
        <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" fixed_value="010.0"/>
    </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="CSCCGA" length="60" location="file">
        <field name="CCG_SOURCE" length="18"/>
        <field name="REG_SENSOR" length="6"/>
        <field name="ORIGIN_LINE" length="7"/>
        <field name="ORIGIN_SAMPLE" length="5"/>
        <field name="AS_CELL_SIZE" length="7"/>
        <field name="CS_CELL_SIZE" length="5"/>
        <field name="CCG_MAX_LINE" length="7"/>
        <field name="CCG_MAX_SAMPLE" length="5"/>
    </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>

    <!-- STDI-0002 Appendix N -->
    <tre name="ENGRDA">
        <field name="RESRC" length="20" type="string"/>
        <field name="RECNT" length="3" type="integer" minval="1"/>
        <loop counter="RECNT" md_prefix="RECORD_%d_" name="RECORDS">
            <field name="ENGLN" length="2" type="integer" minval="1"/>
            <field name="ENGLBL" length_var="ENGLN" type="string"/>
            <field name="ENGMTXC" length="4" type="integer" minval="1"/>
            <field name="ENGMTXR" length="4" type="integer" minval="1"/>
            <field name="ENGTYP" length="1" type="string"/>
            <field name="ENGDTS" length="1" type="integer"/>
            <field name="ENGDTU" length="2" type="string"/>
            <field name="ENGDATC" length="8" type="integer" minval="1" maxval="99999932"/>
            <field name="ENGDATA" length_var="ENGDATC"/>
        </loop>
    </tre>

    <!-- STDI-0002 Appendix E (ASDE 2.1/CN1), Table E-12 -->
    <tre name="EXPLTB" length="101" location="image">
        <field name="ANGLE_TO_NORTH" length="7" type="real" minval="0.0" maxval="359.999"/>
        <field name="ANGLE_TO_NORTH_ACCY" length="6" type="real" minval="0.0" maxval="44.999"/>
        <field name="SQUINT_ANGLE" length="7" type="real" minval="-60.0" maxval="85.0"/>
        <field name="SQUINT_ANGLE_ACCY" length="6" type="real" minval="0.0" maxval="44.999"/>
        <field name="MODE" length="3" type="string"/>
        <field length="16" fixed_value="                "/>
        <field name="GRAZE_ANG" length="5" type="real" unit="degrees" minval="0.0" maxval="90.00"/>
        <field name="GRAZE_ANG_ACCY" length="5" type="real" unit="degrees" minval="0.0" maxval="90.00"/>
        <field name="SLOPE_ANG" length="5" type="real" unit="degrees" minval="0.0" maxval="90.00"/>
        <field name="POLAR" length="2" type="string"/>
        <field name="NSAMP" length="5" type="integer" minval="1" maxval="99999"/>
        <field length="1" fixed_value="0"/>
        <!-- SEQ_NUM is a string because it is <R>, so it may contain a space -->
        <field name="SEQ_NUM" length="1" type="string"/>
        <field name="PRIME_ID" length="12" type="string"/>
        <field name="PRIME_BE" length="15" type="string"/>
        <field length="1" fixed_value="0"/>
        <field name="N_SEC" length="2" type="integer" minval="0" maxval="99"/>
        <field name="IPR" length="2" type="integer" unit="feet" minval="0" maxval="99"/>
    </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="ASYM_FLAG" length="1"/>
            <if cond="ASYM_FLAG=1">
                <field name="ZOOMROW" length="7"/>
                <field name="ZOOMCOL" length="7"/>
            </if>
            <field name="PROJ_FLAG" length="1"/>
            <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="MENSRB" location="image">
        <field name="ACFT_LOC" length="25" type="string"/>
        <field name="ACFT_LOC_ACCY" length ="6" type="real"/>
        <field name="ACFT_ALT" length="6" type="integer"/>
        <field name="RP_LOC" length="25" type="string"/>
        <field name="RP_LOC_ACCY" length="6" type="real"/>
        <field name="RP_ELV" length="6" type="integer" minval="-1000" maxval="30000"/>
        <field name="OF_PC_R" length="7" type="real"/>
        <field name="OF_PC_A" length="7" type="real"/>
        <field name="COSGRZ" length="7" type="real" minval="0.0" maxval="1.0"/>
        <field name="RGCRP" length="7" type="integer" minval="0" maxval="3000000"/>
        <field name="RLMAP" length="1" type="string"/>
        <field name="RP_ROW" length="5" type="integer" minval="1" maxval="99999"/>
        <field name="RP_COL" length="5" type="integer" minval="1" maxval="99999"/>
        <field name="C_R_NC" length="10" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_R_EC" length="10" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_R_DC" length="10" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AZ_NC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AZ_EC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AZ_DC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AL_NC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AL_EC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="C_AL_DC" length="9" type="real" minval="-1.0" maxval="1.0"/>
        <field name="TOTAL_TILES_COLS" length="3" type="integer" minval="1" maxval="999"/>
        <field name="TOTAL_TILES_ROWS" length="5" type="integer" minval="1" maxval="99999"/>
    </tre>

    <!-- STDI-0002 Appendix E (ASDE 2.1/CN1), Section 3.10 and Table E-19 -->
    <tre name="MTIRPB" minlength="119" maxlength="42035">
        <field name="MTI_DP" length="2" type="string"/>
        <field name="MTI_PACKET_ID" length="3" minval="1" maxval="999" type="integer"/>
        <field name="PATCH_NO" length="4" minval="1" maxval="999" type="integer"/>
        <field name="WAMTI_FRAME_NO" length="5" type="string"/>
        <field name="WAMTI_BAR_NO" length="1" type="string"/>
        <field name="DATIME" length="14" type="string"/>
        <field name="ACFT_LOC" length="21" type="string"/>
        <field name="ACFT_ALT" length="6" minval="0" maxval="999999" type="integer"/>
        <field name="ACFT_ALT_UNIT" length="1" type="string"/>
        <field name="ACFT_HEADING" length="3" minval="0" maxval="359" type="integer"/>
        <field name="MTI_LR" length="1" type="string"/>
        <field name="SQUINT_ANGLE" length="6" minval="-60.0" maxval="85.00" type="real"/>
        <field name="COSGRZ" length="7" minval="0" maxval="9.99999" type="real"/>
        <field name="NO_VALID_TARGETS" length="3" minval="1" maxval="999" type="integer"/>
        <loop counter="NO_VALID_TARGETS" md_prefix="TGT_%03d_" name="TARGETS">
            <field name="TGT_LOC" length="23" type="string"/>
            <field name="TGT_LOC_ACCY" length="6" minval="0" maxval="999.99" type="real"/>
            <field name="TGT_VEL_R" length="4" minval="-200" maxval="200" type="string"/>
            <field name="TGT_SPEED" length="3" minval="0" maxval="200" type="string"/>
            <field name="TGT_HEADING" length="3" minval="0" maxval="359" type="string"/>
            <field name="TGT_AMPLITUDE" length="2" minval="0" maxval="15" type="string"/>
            <field name="TGT_CAT" length="1" type="string"/>
        </loop>
    </tre>

    <!-- STDI-0002 Appendix E (ASDE 2.1/CN1), Table E-21 -->
    <tre name="PATCHB" length="121" location="image">
        <field name="PAT_NO" length="4" type="integer" minval="1" maxval="999"/>
        <!-- LAST_PAT_LEVEL is a string because it is <R>, so it may contain only a space -->
        <field name="LAST_PAT_FLAG" length="1" type="integer" minval="0" maxval="1"/>
        <field name="LNSTRT" length="7" type="integer" minval="1" maxval="9999999"/>
        <field name="LNSTOP" length="7" type="integer" minval="20" maxval="9999999"/>
        <field name="AZL" length="5" type="integer" unit="lines" minval="20" maxval="99999"/>
        <!-- NVL is a string because it is <R> -->
        <field name="NVL" length="5" type="string" unit="lines"/>
        <!-- FVL is a string because it is <R> -->
        <field name="FVL" length="3" type="string" minval="1" maxval="681"/>
        <field name="NPIXEL" length="5" type="integer" unit="pixels" minval="1" maxval="99999"/>
        <field name="FVPIX" length="5" type="integer" unit="pixels" minval="1" maxval="99999"/>
        <!-- FRAME is a string because it is <R> -->
        <field name="FRAME" length="3" type="string" minval="1" maxval="512"/>
        <field name="UTC" length="8" type="real" unit="seconds" minval="0.0" maxval="86399.99"/>
        <field name="SHEAD" length="7" type="real" unit="degrees" minval="0.0" maxval="359.999"/>
        <!-- GRAVITY is a string because it is <R> -->
        <field name="GRAVITY" length="7" type="string" unit="feet/sec^2"/>
        <field name="INS_V_NC" length="5" type="integer" unit="feet/sec" minval="-9999" maxval="9999"/>
        <field name="INS_V_EC" length="5" type="integer" unit="feet/sec" minval="-9999" maxval="9999"/>
        <field name="INS_V_DC" length="5" type="integer" unit="feet/sec" minval="-9999" maxval="9999"/>
        <!-- OFFLAT and OFFLONG are string because they are <R> -->
        <field name="OFFLAT" length="8" type="string" unit="seconds"/>
        <field name="OFFLONG" length="8" type="string" unit="seconds"/>
        <field name="TRACK" length="3" type="integer" unit="degrees" minval="0" maxval="359"/>
        <field name="GSWEEP" length="6" type="real" unit="degrees" minval="0.0" maxval="120.0"/>
        <!-- SHEAR is a string because it is <R> -->
        <field name="SHEAR" length="8" type="string"/>
        <!-- BATCH_NO is a string because it is <R> -->
        <field name="BATCH_NO" length="6" type="string"/>
    </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>

    <!-- Table 68 of http://earth-info.nga.mil/publications/specs/printed/89034/89034DPPDB.pdf -->
    <tre name="IMASDA" length="242" location="image">
        <field name="LONTR" length="22" type="real" unit="degrees" minval="-180.0" maxval="180.0"/>
        <field name="LATTR" length="22" type="real" unit="degrees" minval="-90.0" maxval="90.0"/>
        <field name="ELVTR" length="22" type="real" unit="meters" minval="-1000.0" maxval="10000.0"/>
        <field name="LONSC" length="22" type="real" minval="0.0" maxval="100.0"/>
        <field name="LATSC" length="22" type="real" minval="0.0" maxval="100.0"/>
        <field name="ELVSC" length="22" type="real" minval="0.0" maxval="100.0"/>
        <field name="XITR" length="22" type="real" unit="pixels" minval="-10000.0" maxval="10000.0"/>
        <field name="YITR" length="22" type="real" unit="pixels" minval="-10000.0" maxval="10000.0"/>
        <field name="XISC" length="22" type="real" minval="0.0" maxval="100.0"/>
        <field name="YISC" length="22" type="real" minval="0.0" maxval="100.0"/>
        <field name="DELEV" length="22" type="real" unit="meters" minval="-1000.0" maxval="10000.0"/>
    </tre>

    <!-- Table 69 of http://earth-info.nga.mil/publications/specs/printed/89034/89034DPPDB.pdf -->
    <tre name="IMRFCA" length="1760" location="image">
        <loop iterations="20" name="XINC">
            <field name="" longname="XINC" length="22" type="real"/>
        </loop>
        <loop iterations="20" name="XIDC">
            <field name="" longname="XIDC" length="22" type="real"/>
        </loop>
        <loop iterations="20" name="YINC">
            <field name="" longname="YINC" length="22" type="real"/>
        </loop>
        <loop iterations="20" name="YIDC">
            <field name="" longname="YIDC" length="22" 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="SENSRB" location="image">
        <field name="GENERAL_DATA" length="1" type="string"/>
        <if cond="GENERAL_DATA=Y">
            <field name="SENSOR" length="25" type="string"/>
            <field name="SENSOR_URI" length="32" type="string"/>
            <field name="PLATFORM" length="25" type="string"/>
            <field name="PLATFORM_URI" length="32" type="string"/>
            <field name="OPERATION_DOMAIN" length="10" type="string"/>
            <field name="CONTENT_LEVEL" length="1" type="integer" minval="0" maxval="9"/>
            <field name="GEODETIC_SYSTEM" length="5" type="string"/>
            <field name="GEODETIC_TYPE" length="1" type="string"/>
            <field name="ELEVATION_DATUM" length="3" type="string"/>
            <field name="LENGTH_UNIT" length="2" type="string"/>
            <field name="ANGULAR_UNIT" length="3" type="string"/>
            <field name="START_DATE" length="8" type="string"/>
            <field name="START_TIME" length="14" type="real" minval="0.0" maxval="86399.99999999"/>
            <field name="END_DATE" length="8" type="string"/>
            <field name="END_TIME" length="14" type="real" minval="0.0" maxval="86399.99999999"/>
            <field name="GENERATION_COUNT" length="2" type="integer" minval="0" maxval="99"/>
            <field name="GENERATION_DATE" length="8" type="string"/>
            <field name="GENERATION_TIME" length="10" type="string"/>
        </if>
        <field name="SENSOR_ARRAY_DATA" length="1" type="string"/>
        <if cond="SENSOR_ARRAY_DATA=Y">
            <field name="DETECTION" length="20" type="string"/>
            <field name="ROW_DETECTORS" length="8" type="integer"/>
            <field name="COLUMN_DETECTORS" length="8" type="integer"/>
            <field name="ROW_METRIC" length="8" type="string"/>
            <field name="COLUMN_METRIC" length="8" type="string"/>
            <field name="FOCAL_LENGTH" length="8" type="string"/>
            <field name="ROW_FOV" length="8" type="string"/>
            <field name="COLUMN_FOV" length="8" type="string"/>
            <field name="CALIBRATED" length="1" type="string"/>
        </if>
        <field name="SENSOR_CALIBRATION_DATA" length="1" type="string"/>
        <if cond="SENSOR_CALIBRATION_DATA=Y">
            <field name="CALIBRATION_UNIT" length="2" type="string"/>
            <field name="PRINCIPAL_POINT_OFFSET_X" length="9" type="string"/>
            <field name="PRINCIPAL_POINT_OFFSET_Y" length="9" type="string"/>
            <field name="RADIAL_DISTORT_1" length="12" type="string"/>
            <field name="RADIAL_DISTORT_2" length="12" type="string"/>
            <field name="RADIAL_DISTORT_3" length="12" type="string"/>
            <field name="RADIAL_DISTORT_LIMIT" length="9" type="string"/>
            <field name="DECENT_DISTORT_1" length="12" type="string"/>
            <field name="DECENT_DISTORT_2" length="12" type="string"/>
            <field name="AFFINITY_DISTORT_1" length="12" type="string"/>
            <field name="AFFINITY_DISTORT_2" length="12" type="string"/>
            <field name="CALIBRATION_DATE" length="8" type="string"/>
        </if>
        <field name="IMAGE_FORMATION_DATA" length="1" type="string"/>
        <if cond="IMAGE_FORMATION_DATA=Y">
            <field name="METHOD" length="15" type="string"/>
            <field name="MODE" length="3" type="string"/>
            <field name="ROW_COUNT" length="8" type="integer" minval="1" maxval="99999999"/>
            <field name="COLUMN_COUNT" length="8" type="integer" minval="1" maxval="99999999"/>
            <field name="ROW_SET" length="8" type="integer"/>
            <field name="COLUMN_SET" length="8" type="integer"/>
            <field name="ROW_RATE" length="10" type="real"/>
            <field name="COLUMN_RATE" length="10" type="real"/>
            <field name="FIRST_PIXEL_ROW" length="8" type="integer" minval="0" maxval="99999999"/>
            <field name="FIRST_PIXEL_COLUMN" length="8" type="integer" minval="0" maxval="99999999"/>
            <field name="TRANSFORM_PARAMS" length="1" type="integer" minval="0" maxval="8"/>
            <loop counter="TRANSFORM_PARAMS" name="TRANSFORM_PARAM" md_prefix="TRANSFORM_PARAM_%d_">
                <field name="" longname="TRANSFORM_PARAM" length="12" type="string"/>
            </loop>
        </if>
        <field name="REFERENCE_TIME" length="12" type="string"/>
        <field name="REFERENCE_ROW" length="8" type="string"/>
        <field name="REFERENCE_COLUMN" length="8" type="string"/>
        <field name="LATITUDE_OR_X" length="11" type="string"/>
        <field name="LONGITUDE_OR_Y" length="12" type="string"/>
        <field name="ALTITUDE_OR_Z" length="11" type="string"/>
        <field name="SENSOR_X_OFFSET" length="8" type="integer"/>
        <field name="SENSOR_Y_OFFSET" length="8" type="integer"/>
        <field name="SENSOR_Z_OFFSET" length="8" type="integer"/>
        <field name="ATTITUDE_EULER_ANGLES" length="1" type="string"/>
        <if cond="ATTITUDE_EULER_ANGLES=Y">
            <field name="SENSOR_ANGLE_MODEL" length="1" type="integer"/>
            <field name="SENSOR_ANGLE_1" length="10" type="string"/>
            <field name="SENSOR_ANGLE_2" length="9" type="string"/>
            <field name="SENSOR_ANGLE_3" length="10" type="string"/>
            <field name="PLATFORM_RELATIVE" length="1" type="string"/>
            <field name="PLATFORM_HEADING" length="9" type="string"/>
            <field name="PLATFORM_PITCH" length="9" type="string"/>
            <field name="PLATFORM_ROLL" length="10" type="string"/>
        </if>
        <field name="ATTITUDE_UNIT_VECTORS" length="1" type="string"/>
        <if cond="ATTITUDE_UNIT_VECTORS=Y">
            <field name="ICX_NORTH_OR_X" length="10" type="real"/>
            <field name="ICX_EAST_OR_Y" length="10" type="real"/>
            <field name="ICX_DOWN_OR_Z" length="10" type="real"/>
            <field name="ICY_NORTH_OR_X" length="10" type="real"/>
            <field name="ICY_EAST_OR_Y" length="10" type="real"/>
            <field name="ICY_DOWN_OR_Z" length="10" type="real"/>
            <field name="ICZ_NORTH_OR_X" length="10" type="real"/>
            <field name="ICZ_EAST_OR_Y" length="10" type="real"/>
            <field name="ICZ_DOWN_OR_Z" length="10" type="real"/>
        </if>
        <field name="ATTITUDE_QUATERNION" length="1" type="string"/>
        <if cond="ATTITUDE_QUATERNION=Y">
            <field name="ATTITUDE_Q1" length="10" type="real"/>
            <field name="ATTITUDE_Q2" length="10" type="real"/>
            <field name="ATTITUDE_Q3" length="10" type="real"/>
            <field name="ATTITUDE_Q4" length="10" type="real"/>
        </if>
        <field name="SENSOR_VELOCITY_DATA" length="1" type="string"/>
        <if cond="SENSOR_VELOCITY_DATA=Y">
            <field name="VELOCITY_NORTH_OR_X" length="9" type="real"/>
            <field name="VELOCITY_EAST_OR_Y" length="9" type="real"/>
            <field name="VELOCITY_DOWN_OR_Z" length="9" type="real"/>
        </if>
        <field name="POINT_SET_DATA" length="2" type="integer"/>
        <loop counter="POINT_SET_DATA" name="POINT_SETS" md_prefix="POINT_SET_%02d_">
            <field name="POINT_SET_TYPE_MM" length="25" type="string"/>
            <field name="POINT_COUNT_MM" length="3" type="integer"/>
            <loop counter="POINT_COUNT_MM" name="POINT" md_prefix="POINT_%03d_">
                <field name="P_ROW_NNN" length="8" type="integer"/>
                <field name="P_COLUMN_NNN" length="8" type="integer"/>
                <field name="P_LATITUDE_NNN" length="10" type="string"/>
                <field name="P_LONGITUDE_NNN" length="11" type="string"/>
                <field name="P_ELEVATION_NNN" length="6" type="string"/>
                <field name="P_RANGE_NNN" length="8" type="string"/>
            </loop>
        </loop>
        <field name="TIME_STAMPED_DATA_SETS" length="2" type="integer"/>
        <loop counter="TIME_STAMPED_DATA_SETS" name="TIME_STAMPED_SET" md_prefix="TIME_STAMPED_SET_%02d_">
            <field name="TIME_STAMP_TYPE_MM" length="3" type="string"/>
            <field name="TIME_STAMP_COUNT_MM" length="4" type="integer"/>
            <loop counter="TIME_STAMP_COUNT_MM" name="TIME_STAMP_COUNTS" md_prefix="TIME_STAMP_COUNT_%04d_">
                <field name="TIME_STAMP_TIME_NNNN" length="12" type="real"/>
                <if cond="TIME_STAMP_TYPE_MM=05a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="12" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=05b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="8" type="integer"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=05c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="8" type="integer"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="11" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="12" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="11" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06d">
                    <field name="TIME_STAMP_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06e">
                    <field name="TIME_STAMP_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=06f">
                    <field name="TIME_STAMP_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="1" type="integer"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07d">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07e">
                    <field name="TIME_STAMP_VALUE_NNNN" length="1" type="string"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07f">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07g">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=07h">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08d">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08e">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08f">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08g">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08h">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=08i">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=09a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=09b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=09c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=09d">
                    <field name="TIME_STAMP_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=10a">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=10b">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="TIME_STAMP_TYPE_MM=10c">
                    <field name="TIME_STAMP_VALUE_NNNN" length="9" type="real"/>
                </if>
            </loop>
        </loop>
        <field name="PIXEL_REFERENCED_DATA_SETS" length="2" type="integer"/>
        <loop counter="PIXEL_REFERENCED_DATA_SETS" name="PIXEL_REFERENCE_DATA_SET" md_prefix="PIXEL_REFERENCE_DATA_SET_%02d_">
            <field name="PIXEL_REFERENCE_TYPE_MM" length="3" type="string"/>
            <field name="PIXEL_REFERENCE_COUNT_MM" length="4" type="integer"/>
            <loop counter="PIXEL_REFERENCE_COUNT_MM" name="PIXEL_REFERENCE_COUNTS" md_prefix="PIXEL_REFERENCE_COUNT_%04d_">
                <field name="PIXEL_REFERENCE_ROW_NNNN" length="8" type="integer"/>
                <field name="PIXEL_REFERENCE_COLUMN_NNNN" length="8" type="integer"/>
                <if cond="PIXEL_REFERENCE_TYPE_MM=05a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="12" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=05b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="8" type="integer"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=05c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="8" type="integer"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="11" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="12" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="11" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06d">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06e">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=06f">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="8" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="1" type="integer"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07d">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07e">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="1" type="string"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07f">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07g">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=07h">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08d">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08e">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08f">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08g">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08h">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=08i">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=09a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=09b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=09c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=09d">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="10" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=10a">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=10b">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
                <if cond="PIXEL_REFERENCE_TYPE_MM=10c">
                    <field name="PIXEL_REFERENCE_VALUE_NNNN" length="9" type="real"/>
                </if>
            </loop>
        </loop>
        <field name="UNCERTAINTY_DATA" length="3" type="integer"/>
        <loop counter="UNCERTAINTY_DATA" name="UNCERTAINTY_DATA_SETS" md_prefix="UNCERTAINTY_DATA_%03d_">
            <field name="UNCERTAINTY_FIRST_TYPE_NNN" length="11" type="string"/>
            <field name="UNCERTAINTY_SECOND_TYPE_NNN" length="11" type="string"/>
            <field name="UNCERTAINTY_VALUE_NNN" length="10" type="string"/>
        </loop>
        <field name="ADDITIONAL_PARAMETER_DATA" length="3" type="integer"/>
        <loop counter="ADDITIONAL_PARAMETER_DATA" name="ADDITIONAL_PARAMETER_DATA_SETS" md_prefix="ADDITIONAL_PARAMETER_DATA_%03d_">
            <field name="PARAMETER_NAME_MMM" length="25" type="string"/>
            <field name="PARAMETER_SIZE_MMM" length="3" type="integer"/>
            <field name="PARAMETER_COUNT_MMM" length="4" type="integer"/>
            <loop counter="PARAMETER_COUNT_MMM" name="ADDITIONAL_PARAMETER_VALUES" md_prefix="PARAMETER_VALUE_%04d">
                <field name="PARAMETER_VALUE_NNNN" length_var="PARAMETER_SIZE_MMM" type="string"/>
            </loop>
        </loop>
    </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="STREOB" length="94" location="image">
        <field name="ST_ID" length="60" type="string"/>
        <field name="N_MATES" length="1" type="integer"/>
        <field name="MATE_INSTANCE" length="1" type="integer"/>
        <field name="B_CONV" length="5" type="real"/>
        <field name="E_CONV" length="5" type="real"/>
        <field name="B_ASYM" length="5" type="real"/>
        <field name="E_ASYM" length="5" type="real"/>
        <field name="B_BIE" length="6" type="real"/>
        <field name="E_BIE" length="6" type="real"/>
    </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>
