The GPT Cookbook

Collocate


Creates a new file which is a collocated joining of two input source files.


Example 1  Files Which Contain Unique Band Names

Example 2  Files Which May Contain Identical Band Names

Example 3  Use of Suffix as Parameter


Notes 1  Resampling Options








Example 1    Files Which Contain Unique Band Names


This creates a collocated file from two file which contain unique band names. No band names in one input file can match those in the other input file. This is a very simple example of joining two level3 mapped files together.


Command Line Entry

gpt Collocate.xml -Sreference=V20172132017243.L3m_MO_SNPP_CHL_chlor_a_9km.nc -Sdependent=V20172132017243.L3m_MO_SNPP_KD490_Kd_490_9km.nc -t CollocateEx01.dim

File = Collocate.xml

<graph id="CollocateGraph">
  <version>1.0</version>
  <node id="CollocateNode">
    <operator>Collocate</operator>
    <sources>
      <master>${reference}</master>
      <slave>${dependent}</slave>
    </sources>
    <parameters>
        <targetProductType>COLLOCATED</targetProductType>
        <renameMasterComponents>false</renameMasterComponents>
        <renameSlaveComponents>false</renameSlaveComponents>
        <resamplingType>NEAREST_NEIGHBOUR</resamplingType>
    </parameters>
  </node>
</graph>




Example 2    Files Which May Contain Identical Band Names


This creates a collocated file from two file which may contain identical band names. To accomplish this, the original band name is preserved with the addition of a suffix relating to which source file the band came from.


Command Line Entry

gpt CollocatePattern.xml -Sreference=A20020012002365.L3m_YR_NSST_sst_9km.nc -Sdependent=A20160012016366.L3m_YR_NSST_sst_9km.nc -p CollocateEx02.par -t CollocateEx02.dim

File = CollocatePattern.xml

<graph id="CollocatePatternGraph">
  <version>1.0</version>
  <node id="CollocatePatternNode">
    <operator>Collocate</operator>
    <sources>
      <master>${reference}</master>
      <slave>${dependent}</slave>
    </sources>
    <parameters>
        <targetProductType>COLLOCATED</targetProductType>
        <renameMasterComponents>${renameReference}</renameMasterComponents>
        <renameSlaveComponents>${renameDependent}</renameSlaveComponents>
        <masterComponentPattern>${referenceComponentPattern}</masterComponentPattern>
        <slaveComponentPattern>${dependentComponentPattern}</slaveComponentPattern>
        <resamplingType>${resamplingType}</resamplingType>
    </parameters>
  </node>
</graph>

File = CollocateEx02.par

renameReference=true
renameDependent=true
referenceComponentPattern=${ORIGINAL_NAME}_R
dependentComponentPattern=${ORIGINAL_NAME}_D
resamplingType=NEAREST_NEIGHBOUR




Example 3    Use of Suffix as Parameter


A slight variant on example 2 where now we pass in band names suffixes related to the actual input file names.


Command Line Entry

gpt CollocateAddSuffix.xml -Sreference=A20020012002365.L3m_YR_NSST_sst_9km.nc -PreferenceSuffix=2002 -Sdependent=A20160012016366.L3m_YR_NSST_sst_9km.nc -PdependentSuffix=2016 -p CollocateEx03.par -t CollocateEx03.dim

File = CollocateAddSuffix.xml

<graph id="CollocateAddSuffixGraph">
  <version>1.0</version>
  <node id="CollocateAddSuffixNode">
    <operator>Collocate</operator>
    <sources>
      <master>${reference}</master>
      <slave>${dependent}</slave>
    </sources>
    <parameters>
        <targetProductType>COLLOCATED</targetProductType>
        <renameMasterComponents>${renameReference}</renameMasterComponents>
        <renameSlaveComponents>${renameDependent}</renameSlaveComponents>
        <masterComponentPattern>${ORIGINAL_NAME}_${referenceSuffix}</masterComponentPattern>
        <slaveComponentPattern>${ORIGINAL_NAME}_${dependentSuffix}</slaveComponentPattern>
        <resamplingType>${resamplingType}</resamplingType>
    </parameters>
  </node>
</graph>

File = CollocateEx03.par

renameReference=true
renameDependent=true
resamplingType=NEAREST_NEIGHBOUR




Notes 1    Resampling Options


Here is a full list of the resampling options and their specific names as used by the Collocate operator. Please be aware that these names differ for the operators Reproject and Mosaic. We will address this in a future SeaDAS release.

resamplingType=NEAREST_NEIGHBOUR
resamplingType=BILINEAR_INTERPOLATION
resamplingType=CUBIC_CONVOLUTION
resamplingType=BISINC_INTERPOLATION
resamplingType=BICUBIC_INTERPOLATION