## GPT Cookbook: PixEx

Creates a text based file containing band values for single pixels or aggregate values for a grid of pixels.

Example 1 Matchups to In Situ Cruise Stations

This uses a data file which contains measurement time and location for an in situ cruise. It then extracts matching pixels (in the form of 5x5 mean aggregate) for an input level-2 file with criteria restrictions of a 3 hour time window and several quality flags.

Command Line Entry

    gpt PixExGraph.xml -Pifile=A2010317175500.L2_LAC_OC.nc -p PixEx.par -Phome=$HOME -PoutputFilePrefix=CV5_A2010317175500 -PcoordinatesFile=cruiseCV5_2010317.txt

File = PixExGraph.xml

    <graph id="PixExGraph">
      <version>1.0</version>
      <node id="Read">
        <operator>Read</operator>
        <sources/>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
           <file>${ifile}</file>
           <formatName>SeaDAS-L2</formatName>
        </parameters>
      </node>
      <node id="PixEx">
        <operator>PixEx</operator>
        <sources>
          <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
          <outputDir>${home}/${outputDir}</outputDir>:
          <outputFilePrefix>${outputFilePrefix}</outputFilePrefix>

          <coordinatesFile>${home}/${coordinatesFileDir}/${coordinatesFile}</coordinatesFile>
          <timeDifference>${timeDifference}</timeDifference>

          <exportBands>${exportBands}</exportBands>
          <exportTiePoints>${exportTiePoints}</exportTiePoints>
          <exportMasks>${exportMasks}</exportMasks>

          <windowSize>${windowSize}</windowSize>
          <aggregatorStrategyType>${aggregatorStrategyType}</aggregatorStrategyType>

          <expression>${expression}</expression>

          <exportExpressionResult>false</exportExpressionResult>

        </parameters>

      </node>
    </graph>

File = PixEx.par

    #home=DEFINED_ON_COMMAND_LINE

    outputDir=Desktop/GptExamples/help/PixEx/
    #outputFilePrefix=DEFINED_ON_COMMAND_LINE

    coordinatesFileDir=Desktop/GptExamples/help/PixEx
    #coordinatesFile=DEFINED_ON_COMMAND_LINE

    timeDifference=3H

    exportBands=true
    exportTiePoints=false
    exportMasks=false

    windowSize=5
    aggregatorStrategyType=mean

    expression=!(l2_flags.HIGLINT and l2_flags.HISATZEN and l2_flags.STRAYLIGHT)

File = cruiseCV5_2010317.txt*
* The coordinates file must be tab delimited -- exactly one tab and no character spaces between each field.

    DateTime	Name	Lat	Lon
    2010-11-13T12:03:00	52	40.7537	-70.7162
    2010-11-13T14:05:00	53	40.5477	-70.5050
    2010-11-13T15:32:00	53B	40.3522	-70.3797
    2010-11-13T18:02:00	54	40.0255	-70.1460
    2010-11-13T20:00:00	54A	40.2033	-70.0627
    2010-11-13T21:18:00	55	40.3577	-69.9882