GPT Cookbook: Band Maths


Creates a new file with math band(s) based on an input source file with the option to retain source file bands in the new file.



Example 1  Create only Math Bands

Example 2  Create Math Bands and Retain Chlor_a and Kd_490 bands

Example 3  Create Math Bands and Retain Chlor_a and Kd_490 bands (Variables Option)

Example 4  Remove the "_count" Bands from a Mosaic File (OC Level2)

Example 5  Create Math Bands and Retain All OC Bands





Example 1    Create only Math Bands


This creates a new file based off an input source file adding math band(s) to it (the bands and masks of the source file are not transferred to the output file).


Command Line Entry

gpt BandMathsGraphEx01.xml -p BandMathsEx01.par -Pifile=A2010283180500.L2_LAC_OC.nc -Pofile=A2010283180500.L2_LAC_OC_BandMathsEx01.dim

File = BandMathsGraphEx01.xml

<graph id="BandMathsGraphEx01">
    <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="BandMaths">
        <operator>BandMaths</operator>
        <sources>
            <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <targetBands>
                <targetBand>
                    <name>${band1Name}</name>
                    <type>${band1Type}</type>
                    <expression>${band1Expression}</expression>
                    <description>${band1Description}</description>
                    <unit>${band1Unit}</unit>
                    <validExpression>${band1ValidExpression}</validExpression>
                    <noDataValue>${band1NoDataValue}</noDataValue>
                    <spectralWavelength>${band1SpectralWavelength}</spectralWavelength>
                    <spectralBandwidth>${band1SpectralBandwidth}</spectralBandwidth>
                </targetBand>
            </targetBands>
        </parameters>
    </node>
    <node id="Write">
        <operator>Write</operator>
        <sources>
            <sourceProduct refid="BandMaths"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>${ofile}</file>
            <formatName>BEAM-DIMAP</formatName>
        </parameters>
    </node>
</graph>

File = BandMathsEx01.par

band1Name=aod
band1Type=float64
band1Expression=if (Kd_490 &gt; 0) then 1.3/Kd_490 else NaN
band1Description=apparent optical depth
band1Unit=meters
band1ValidExpression=aod &gt; (1.3/6.0) and aod &lt; (1.3/0.01)
band1NoDataValue=-0.19837031
band1SpectralWavelength=490.0
band1SpectralBandwidth=10.0

Here is what example 1 would look like if you use the GUI, in which case there are no variables. The following graph will load into the GUI via the GraphBuilder tool (note: you need to edit the ifile and ofile paths).

Also note that 3 fields of the BandMaths tool are not available within the GUI but are available at the command line: validExpression, spectralWavelength, and spectralBandwidth.


File = BandMathsGraphGUIEx01.xml

<graph id="Graph">
    <version>1.0</version>
    <node id="Read">
        <operator>Read</operator>
        <sources/>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>/Users/seadas/GPT_Cookbook/BandMathsEx01/A2010283180500.L2_LAC_OC.nc</file>
            <formatName>SeaDAS-L2</formatName>
        </parameters>
    </node>
    <node id="BandMaths">
        <operator>BandMaths</operator>
        <sources>
            <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <targetBands>
                <targetBand>
                    <name>aod</name>
                    <type>float32</type>
                    <expression>if (Kd_490 &gt; 0) then 1.3/Kd_490 else NaN</expression>
                    <description/>
                    <unit>meters</unit>
                    <noDataValue>-0.19837031</noDataValue>
                </targetBand>
            </targetBands>
            <variables/>
        </parameters>
    </node>
    <node id="Write">
        <operator>Write</operator>
        <sources>
            <sourceProduct refid="BandMaths"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>/Users/seadas/GPT_Cookbook/BandMathsEx01/A2010283180500.L2_LAC_OC.nc_BandMath.dim</file>
            <formatName>BEAM-DIMAP</formatName>
        </parameters>
    </node>
    <applicationData id="Presentation">
        <Description/>
        <node id="Read">
            <displayPosition x="37.0" y="134.0"/>
        </node>
        <node id="BandMaths">
            <displayPosition x="230.0" y="226.0"/>
        </node>
        <node id="Write">
            <displayPosition x="455.0" y="135.0"/>
        </node>
    </applicationData>
</graph>



Example 2    Create Math Band(s) plus chlor_a and Kd_490


This creates a new file based off an input source file adding to it Chlor_a, Kd_490 and math band(s) (the bands and masks of the source file are not transferred to the output file).


Command Line Entry

gpt BandMathsGraphEx02.xml -p BandMathsEx02.par -Pifile=A2010283180500.L2_LAC_OC.nc -Pofile=A2010283180500.L2_LAC_OC_BandMathsEx02.dim

File = BandMathsGraphEx02.xml

<graph id="BandMathsGraphEx02">
    <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="BandMaths">
        <operator>BandMaths</operator>
        <sources>
            <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <targetBands>
                <targetBand>
                    <name>${band1Name}</name>
                    <type>${band1Type}</type>
                    <expression>${band1Expression}</expression>
                    <description>${band1Description}</description>
                    <unit>${band1Unit}</unit>
                    <validExpression>${band1ValidExpression}</validExpression>
                    <noDataValue>${band1NoDataValue}</noDataValue>
                    <spectralWavelength>${band1SpectralWavelength}</spectralWavelength>
                    <spectralBandwidth>${band1SpectralBandwidth}</spectralBandwidth>
                </targetBand>

                <targetBand>
                    <name>chlor_a</name>
                    <type>float64</type>
                    <expression>chlor_a</expression>
                    <description>Chlorophyll Concentration, OCI algorithm</description>
                    <unit>mg m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Kd_490</name>
                    <type>float64</type>
                    <expression>Kd_490</expression>
                    <description>Diffuse attenuation coefficient at 498 nm, KD2 algorithm</description>
                    <unit>m^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>490.0</spectralWavelength>
                </targetBand>


            </targetBands>
        </parameters>
    </node>
    <node id="Write">
        <operator>Write</operator>
        <sources>
            <sourceProduct refid="BandMaths"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>${ofile}</file>
            <formatName>BEAM-DIMAP</formatName>
        </parameters>
    </node>
</graph>

File = BandMathsEx02.par

band1Name=aod
band1Type=float64
band1Expression=if (Kd_490 &gt; 0) then 1.3/Kd_490 else NaN
band1Description=apparent optical depth
band1Unit=meters
band1ValidExpression=Kd_490 &gt;= 0.01000 and Kd_490 &lt;= 6.00000
band1NoDataValue=-0.19837031
band1SpectralWavelength=490.0
band1SpectralBandwidth=10.0
Note that a difference between Example 2 and Example 1 is that because in Example 2 the source band Kd_490 is present in the output file it is possible to have the validExpression point to Kd_490.



Example 3     Create Math Band and Retain chlor_a and Kd_490 Bands (Variables Option)


This creates a copy of a file adding math band(s), chlor_a and Kd_490 bands to it.

This is exactly the same as example 2 except it illustrates the use of the variable options.

Note: variables only apply to parameter "expression" and not to parameter "validExpression".


Command Line Entry

gpt BandMathsGraphEx03.xml -p BandMathsEx03.par -Pifile=A2010283180500.L2_LAC_OC.nc -Pofile=A2010283180500.L2_LAC_OC_BandMathsEx03.dim

File = BandMathsGraphEx03.xml

<graph id="BandMathsGraphEx03">
    <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="BandMaths">
        <operator>BandMaths</operator>
        <sources>
            <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <targetBands>
                <targetBand>
                    <name>${band1Name}</name>
                    <type>${band1Type}</type>
                    <expression>${band1Expression}</expression>
                    <description>${band1Description}</description>
                    <unit>${band1Unit}</unit>
                    <validExpression>${band1ValidExpression}</validExpression>
                    <noDataValue>${band1NoDataValue}</noDataValue>
                    <spectralWavelength>${band1SpectralWavelength}</spectralWavelength>
                    <spectralBandwidth>${band1SpectralBandwidth}</spectralBandwidth>
                </targetBand>

                <targetBand>
                    <name>chlor_a</name>
                    <type>float64</type>
                    <expression>chlor_a</expression>
                    <description>Chlorophyll Concentration, OCI algorithm</description>
                    <unit>mg m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Kd_490</name>
                    <type>float64</type>
                    <expression>Kd_490</expression>
                    <description>Diffuse attenuation coefficient at 498 nm, KD2 algorithm</description>
                    <unit>m^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>490.0</spectralWavelength>
                </targetBand>

            </targetBands>
            <variables>
                <variable>
                    <name>${var1Name}</name>
                    <type>${var1Type}</type>
                    <value>${var1Value}</value>
                </variable>
            </variables>
        </parameters>
    </node>
    <node id="Write">
        <operator>Write</operator>
        <sources>
            <sourceProduct refid="BandMaths"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>${ofile}</file>
            <formatName>BEAM-DIMAP</formatName>
        </parameters>
    </node>
</graph>

File = BandMathsEx03.par

copySourceFile=true
band1Name=aod
band1Type=float64
band1Expression=if (Kd_490 &gt; 0) then (AOD_KD490_FACTOR/Kd_490) else NaN
band1Description=apparent optical depth
band1Unit=meters
band1ValidExpression=Kd_490 &gt;= 0.01000 and Kd_490 &lt;= 6.00000
band1NoDataValue=-0.19837031
band1SpectralWavelength=490.0
band1SpectralBandwidth=10.0
var1Name=AOD_KD490_FACTOR
var1Type=float64
var1Value=1.3




Example 4    Remove the "_count" Bands from a Mosaic File (OC Level2)


For each band in a Mosaic file there is a corresponding "count" band used in its validPixelExpression (for instance the chlor_a band sets it's validPixelExpression based on the chlor_a_count band: expr= chlor_a_count > 0). In this example we take a Mosaic file and by using the BandMaths operator to apply the validPixelExpression, we create a new file which does not contain these "count" bands.

This example is doing the full set of 20 bands in the OC suite (Note: this example has been prepared during the SeaDAS 7.5 release, so any product changes in the future for the OC suite are not accounted for here).

The source file A2017023193500_MosaicEx05.dim used here was produced by Mosaic Example 5


Command Line Entry

gpt BandMathsGraphEx04.xml -p BandMathsEx04.par -Pifile=A2017023193500_MosaicEx05.dim -Pofile=A2017023193500_BandMathsEx04.dim

File = BandMathsGraphEx04.xml

<graph id="BandMathsGraphEx04">
  <version>1.0</version>
  <node id="Read">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
        <file>${ifile}</file>
        <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>
  <node id="BandMaths">
    <operator>BandMaths</operator>
    <sources>
      <sourceProduct refid="Read">
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <targetBands>
        <targetBand>
          <name>${band1Name}</name>
          <type>float64</type>
          <expression>if (${band1Name}_count &gt; 0) then ${band1Name} else ${noDataValue}</expression>
          <description>${band1Description}</description>
          <unit>${band1Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band1SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band2Name}</name>
          <type>float64</type>
          <expression>if (${band2Name}_count &gt; 0) then ${band2Name} else ${noDataValue}</expression>
          <description>${band2Description}</description>
          <unit>${band2Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band2SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band3Name}</name>
          <type>float64</type>
          <expression>if (${band3Name}_count &gt; 0) then ${band3Name} else ${noDataValue}</expression>
          <description>${band3Description}</description>
          <unit>${band3Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band3SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band4Name}</name>
          <type>float64</type>
          <expression>if (${band4Name}_count &gt; 0) then ${band4Name} else ${noDataValue}</expression>
          <description>${band4Description}</description>
          <unit>${band4Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band4SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band5Name}</name>
          <type>float64</type>
          <expression>if (${band5Name}_count &gt; 0) then ${band5Name} else ${noDataValue}</expression>
          <description>${band5Description}</description>
          <unit>${band5Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band5SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band6Name}</name>
          <type>float64</type>
          <expression>if (${band6Name}_count &gt; 0) then ${band6Name} else ${noDataValue}</expression>
          <description>${band6Description}</description>
          <unit>${band6Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band6SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band7Name}</name>
          <type>float64</type>
          <expression>if (${band7Name}_count &gt; 0) then ${band7Name} else ${noDataValue}</expression>
          <description>${band7Description}</description>
          <unit>${band7Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band7SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band8Name}</name>
          <type>float64</type>
          <expression>if (${band8Name}_count &gt; 0) then ${band8Name} else ${noDataValue}</expression>
          <description>${band8Description}</description>
          <unit>${band8Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band8SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band9Name}</name>
          <type>float64</type>
          <expression>if (${band9Name}_count &gt; 0) then ${band9Name} else ${noDataValue}</expression>
          <description>${band9Description}</description>
          <unit>${band9Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band9SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band10Name}</name>
          <type>float64</type>
          <expression>if (${band10Name}_count &gt; 0) then ${band10Name} else ${noDataValue}</expression>
          <description>${band10Description}</description>
          <unit>${band10Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band10SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band11Name}</name>
          <type>float64</type>
          <expression>if (${band11Name}_count &gt; 0) then ${band11Name} else ${noDataValue}</expression>
          <description>${band11Description}</description>
          <unit>${band11Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band11SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band12Name}</name>
          <type>float64</type>
          <expression>if (${band12Name}_count &gt; 0) then ${band12Name} else ${noDataValue}</expression>
          <description>${band12Description}</description>
          <unit>${band12Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band12SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band13Name}</name>
          <type>float64</type>
          <expression>if (${band13Name}_count &gt; 0) then ${band13Name} else ${noDataValue}</expression>
          <description>${band13Description}</description>
          <unit>${band13Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band13SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band14Name}</name>
          <type>float64</type>
          <expression>if (${band14Name}_count &gt; 0) then ${band14Name} else ${noDataValue}</expression>
          <description>${band14Description}</description>
          <unit>${band14Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band14SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band15Name}</name>
          <type>float64</type>
          <expression>if (${band15Name}_count &gt; 0) then ${band15Name} else ${noDataValue}</expression>
          <description>${band15Description}</description>
          <unit>${band15Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band15SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band16Name}</name>
          <type>float64</type>
          <expression>if (${band16Name}_count &gt; 0) then ${band16Name} else ${noDataValue}</expression>
          <description>${band16Description}</description>
          <unit>${band16Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band16SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band17Name}</name>
          <type>float64</type>
          <expression>if (${band17Name}_count &gt; 0) then ${band17Name} else ${noDataValue}</expression>
          <description>${band17Description}</description>
          <unit>${band17Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band17SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band18Name}</name>
          <type>float64</type>
          <expression>if (${band18Name}_count &gt; 0) then ${band18Name} else ${noDataValue}</expression>
          <description>${band18Description}</description>
          <unit>${band18Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band18SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band19Name}</name>
          <type>float64</type>
          <expression>if (${band19Name}_count &gt; 0) then ${band19Name} else ${noDataValue}</expression>
          <description>${band19Description}</description>
          <unit>${band19Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band19SpectralWavelength}</spectralWavelength>
        </targetBand>

        <targetBand>
          <name>${band20Name}</name>
          <type>float64</type>
          <expression>if (${band20Name}_count &gt; 0) then ${band20Name} else ${noDataValue}</expression>
          <description>${band20Description}</description>
          <unit>${band20Unit}</unit>
          <noDataValue>${noDataValue}</noDataValue>
          <spectralWavelength>${band20SpectralWavelength}</spectralWavelength>
        </targetBand>

      </targetBands>
    </parameters>
  </node>
  <node id="Write">
    <operator>Write</operator>
    <sources>
    <sourceProduct refid="BandMaths"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
        <file>${ofile}</file>
        <formatName>BEAM-DIMAP</formatName>
    </parameters>
  </node>
</graph>

File = BandMathsEx04.par

noDataValue=NaN

band1Name=aot_869
band1Description=Aerosol optical thickness at 869 nm
band1Unit=
band1SpectralWavelength=869

band2Name=angstrom
band2Description=Aerosol Angstrom exponent, 443 to 865 nm
band2Unit=
band2SpectralWavelength=0.0

band3Name=chlor_a
band3Description=Chlorophyll Concentration, OCI Algorithm
band3Unit=mg m^-3
band3SpectralWavelength=0.0

band4Name=chl_ocx
band4Description=Chlorophyll Concentration, OC3 Algorithm
band4Unit=mg m^-3
band4SpectralWavelength=0.0

band5Name=ipar
band5Description=Instantaneous Photosynthetically Available Radiation
band5Unit=einstein m^-2 s^-1
band5SpectralWavelength=0.0

band6Name=Kd_490
band6Description=Diffuse attenuation coefficient at 490 nm, KD2 algorithm
band6Unit=m^-1
band6SpectralWavelength=490.0

band7Name=nflh
band7Description=Normalized Fluorescence Line Height
band7Unit=W m^-2 um^-1 sr^-1
band7SpectralWavelength=0.0

band8Name=Rrs_412
band8Description=Remote sensing reflectance at 412 nm
band8Unit=sr^-1
band8SpectralWavelength=412

band9Name=Rrs_443
band9Description=Remote sensing reflectance at 443 nm
band9Unit=sr^-1
band9SpectralWavelength=443

band10Name=Rrs_469
band10Description=Remote sensing reflectance at 469 nm
band10Unit=sr^-1
band10SpectralWavelength=469

band11Name=Rrs_488
band11Description=Remote sensing reflectance at 488 nm
band11Unit=sr^-1
band11SpectralWavelength=488

band12Name=Rrs_531
band12Description=Remote sensing reflectance at 531 nm
band12Unit=sr^-1
band12SpectralWavelength=531

band13Name=Rrs_547
band13Description=Remote sensing reflectance at 547 nm
band13Unit=sr^-1
band13SpectralWavelength=547

band14Name=Rrs_555
band14Description=Remote sensing reflectance at 555 nm
band14Unit=sr^-1
band14SpectralWavelength=555

band15Name=Rrs_645
band15Description=Remote sensing reflectance at 645 nm
band15Unit=sr^-1
band15SpectralWavelength=645

band16Name=Rrs_667
band16Description=Remote sensing reflectance at 667 nm
band16Unit=sr^-1
band16SpectralWavelength=667

band17Name=Rrs_678
band17Description=Remote sensing reflectance at 678 nm
band17Unit=sr^-1
band17SpectralWavelength=678

band18Name=par
band18Description=Photosynthetically Available Radiation, R. Frouin
band18Unit=einstein m^-2 day^-1
band18SpectralWavelength=0.0

band19Name=pic
band19Description=Calcite Concentration, Balch and Gordon
band19Unit=mol m^-3
band19SpectralWavelength=0.0

band20Name=poc
band20Description=Particulate Organic Carbon, D. Stramski, 2007 (443/555 version)
band20Unit=mg m^-3
band20SpectralWavelength=0.0



Example 5    Create Math Band(s) and Retain all OC Bands


This creates a new file based off an input source file adding to it math band(s) and the 20 OC bands(the masks of the source file are not transferred to the output file).


Command Line Entry

gpt BandMathsGraphEx05.xml -p BandMathsEx05.par -Pifile=A2010283180500.L2_LAC_OC.nc -Pofile=A2010283180500.L2_LAC_OC_BandMathsEx05.dim

File = BandMathsGraphEx05.xml

<graph id="BandMathsGraphEx05">
    <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="BandMaths">
        <operator>BandMaths</operator>
        <sources>
            <sourceProduct refid="Read"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <targetBands>
                <targetBand>
                    <name>${band1Name}</name>
                    <type>${band1Type}</type>
                    <expression>${band1Expression}</expression>
                    <description>${band1Description}</description>
                    <unit>${band1Unit}</unit>
                    <validExpression>${band1ValidExpression}</validExpression>
                    <noDataValue>${band1NoDataValue}</noDataValue>
                    <spectralWavelength>${band1SpectralWavelength}</spectralWavelength>
                    <spectralBandwidth>${band1SpectralBandwidth}</spectralBandwidth>
                </targetBand>

                <targetBand>
                    <name>aot_869</name>
                    <type>float64</type>
                    <expression>aot_869</expression>
                    <description>Aerosol optical thickness at 869 nm</description>
                    <unit/>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>869</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>angstrom</name>
                    <type>float64</type>
                    <expression>angstrom</expression>
                    <description>Aerosol Angstrom exponent, 443 to 865 nm</description>
                    <unit/>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>chlor_a</name>
                    <type>float64</type>
                    <expression>chlor_a</expression>
                    <description>Chlorophyll Concentration, OCI algorithm</description>
                    <unit>mg m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>chl_ocx</name>
                    <type>float64</type>
                    <expression>chl_ocx</expression>
                    <description>Chlorophyll Concentration, OC3 algorithm</description>
                    <unit>mg m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>ipar</name>
                    <type>float64</type>
                    <expression>ipar</expression>
                    <description>Instantaneous Photosynthetically Available Radiation</description>
                    <unit>einstein m^-2 s^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Kd_490</name>
                    <type>float64</type>
                    <expression>Kd_490</expression>
                    <description>Diffuse attenuation coefficient at 498 nm, KD2 algorithm</description>
                    <unit>m^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>490.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>nflh</name>
                    <type>float64</type>
                    <expression>nflh</expression>
                    <description>Normalized Fluorescence Line Height</description>
                    <unit>W m^-2 um^-1 sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_412</name>
                    <type>float64</type>
                    <expression>Rrs_412</expression>
                    <description>Remote sensing reflectance at 412 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>412</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_443</name>
                    <type>float64</type>
                    <expression>Rrs_443</expression>
                    <description>Remote sensing reflectance at 443 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>443</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_469</name>
                    <type>float64</type>
                    <expression>Rrs_469</expression>
                    <description>Remote sensing reflectance at 469 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>469</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_488</name>
                    <type>float64</type>
                    <expression>Rrs_488</expression>
                    <description>Remote sensing reflectance at 488 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>488</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_531</name>
                    <type>float64</type>
                    <expression>Rrs_531</expression>
                    <description>Remote sensing reflectance at 531 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>531</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_547</name>
                    <type>float64</type>
                    <expression>Rrs_547</expression>
                    <description>Remote sensing reflectance at 547 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>547</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_555</name>
                    <type>float64</type>
                    <expression>Rrs_555</expression>
                    <description>Remote sensing reflectance at 555 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>555</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_645</name>
                    <type>float64</type>
                    <expression>Rrs_645</expression>
                    <description>Remote sensing reflectance at 645 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>645</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_667</name>
                    <type>float64</type>
                    <expression>Rrs_667</expression>
                    <description>Remote sensing reflectance at 667 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>667</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>Rrs_678</name>
                    <type>float64</type>
                    <expression>Rrs_678</expression>
                    <description>Remote sensing reflectance at 678 nm</description>
                    <unit>sr^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>678</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>par</name>
                    <type>float64</type>
                    <expression>par</expression>
                    <description>Photosynthetically Available Radiation, R. Frouin</description>
                    <unit>einstein m^-2 day^-1</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>pic</name>
                    <type>float64</type>
                    <expression>pic</expression>
                    <description>Calcite Concentration, Balch and Gordon</description>
                    <unit>mol m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

                <targetBand>
                    <name>poc</name>
                    <type>float64</type>
                    <expression>poc</expression>
                    <description>Particulate Organic Carbon, D. Stramski, 2007 (443/555 version)</description>
                    <unit>mg m^-3</unit>
                    <noDataValue>NaN</noDataValue>
                    <spectralWavelength>0.0</spectralWavelength>
                </targetBand>

            </targetBands>
        </parameters>
    </node>
    <node id="Write">
        <operator>Write</operator>
        <sources>
            <sourceProduct refid="BandMaths"/>
        </sources>
        <parameters class="com.bc.ceres.binding.dom.XppDomElement">
            <file>${ofile}</file>
            <formatName>BEAM-DIMAP</formatName>
        </parameters>
    </node>
</graph>

File = BandMathsEx05.par

band1Name=aod
band1Type=float64
band1Expression=if (Kd_490 &gt; 0) then 1.3/Kd_490 else NaN
band1Description=apparent optical depth
band1Unit=meters
band1ValidExpression=Kd_490 &gt;= 0.01000 and Kd_490 &lt;= 6.00000
band1NoDataValue=-0.19837031
band1SpectralWavelength=490.0
band1SpectralBandwidth=10.0