GPT Cookbook: LandWaterMask


Creates a file which is a copy of an input source file, adding a land band, land mask, water mask and coast mask.


Example 1  Add Land Mask to 9km File (Simple)

Example 2  Add Land Mask to 4km File (Simple)

Example 3  Add Land Mask to 1km File (Simple)

Example 4  Add Land Mask to 300 meter File (Simple)

Example 5  Add Land Mask to 30 meter File (Simple)

Example 6  Add Land Mask to 9km File (Custom)


Note 1  Parameters: resolution and superSamplingFactor

Note 2  Installing the 50m and 150m Land Data Set








Example 1    Add Land Mask to 9km File (Simple)


This creates a copy of a 9km resolution file, adding to it a land band, land mask, water mask and coast mask.


Command Line Entry

gpt LandWaterMaskSimple.xml -p LandWaterMaskEx01.par -Ssource=A20172132017243.L3m_MO_NSST_sst_9km.nc -t A20172132017243.L3m_MO_NSST_sst_9km_land.dim

File = LandWaterMaskSimple.xml

<graph id="LandWaterMaskGraph">
  <version>1.0</version>

    <node id="LandWaterMaskNode">
      <operator>LandWaterMask</operator>
      <sources>
        <source>${source}</source>
      </sources>
      <parameters>
        <resolution>${resolution}</resolution>
        <superSamplingFactor>${superSamplingFactor}</superSamplingFactor>
      </parameters>
    </node>

</graph>

File = LandWaterMaskEx01.par

resolution=10000
superSamplingFactor=3




Example 2    Add Land Mask to 4km File (Simple)


This creates a copy of a 4km resolution file, adding to it a land band, land mask, water mask and coast mask.

Uses graph file "LandWaterMaskSimple.xml" from example 1.


Command Line Entry

gpt LandWaterMaskSimple.xml -p LandWaterMaskEx02.par -Ssource=A20172132017243.L3m_MO_NSST_sst_4km.nc -t A20172132017243.L3m_MO_NSST_sst_4km_land.dim

File = LandWaterMaskEx02.par

resolution=1000
superSamplingFactor=6




Example 3    Add Land Mask to 1km File (Simple)


This creates a copy of a 1km resolution file, adding to it a land band, land mask, water mask and coast mask.

Uses graph file "LandWaterMaskSimple.xml" from example 1.


Command Line Entry

gpt LandWaterMaskSimple.xml -p LandWaterMaskEx03.par -Ssource=A2010283180500.L2_LAC_OC.nc -t A2010283180500.L2_LAC_OC_land.dim

File = LandWaterMaskEx03.par

resolution=1000
superSamplingFactor=3




Example 4    Add Land Mask to 300m File (Simple)


This creates a copy of a 300m resolution file, adding to it a land band, land mask, water mask and coast mask.

Uses graph file "LandWaterMaskSimple.xml" from example 1.


Command Line Entry

gpt LandWaterMaskSimple.xml -p LandWaterMaskEx04.par -Ssource=A2010283180500_subset_300m.dim -t A2010283180500_subset_300m_land.dim

File = LandWaterMaskEx04.par

resolution=50
superSamplingFactor=8




Example 5    Add Land Mask to 30m File (Simple)


This creates a copy of a 30m resolution file, adding to it a land band, land mask, water mask and coast mask.

Uses graph file "LandWaterMaskSimple.xml" from example 1.


Command Line Entry

gpt LandWaterMaskSimple.xml -p LandWaterMaskEx05.par -Ssource=A2010283180500_subset_30m.dim -t A2010283180500_subset_30m_land.dim

File = LandWaterMaskEx05.par

resolution=50
superSamplingFactor=3




Example 6    Add Land Mask to 9km File (Custom)


This creates a copy of a 9km resolution file, adding to it a land band, land mask, water mask and coast mask.

This is the same as example 1 with the exception that here all parameters are being defined as variables in the par file.


Command Line Entry

gpt LandWaterMask.xml -p LandWaterMaskEx06.par -Ssource=A20172132017243.L3m_MO_NSST_sst_9km.nc -t A20172132017243.L3m_MO_NSST_sst_9km_land.dim

File = LandWaterMask.xml

<graph id="LandWaterMaskGraph">
  <version>1.0</version>

    <node id="LandWaterMaskNode">
      <operator>LandWaterMask</operator>
      <sources>
        <source>${source}</source>
      </sources>
      <parameters>
        <resolution>${resolution}</resolution>
        <superSamplingFactor>${superSamplingFactor}</superSamplingFactor>
        <copySourceFile>${copySourceFile}</copySourceFile>
        <coastalGridSize>${coastalGridSize}</coastalGridSize>
        <coastalSizeTolerance>${coastalSizeTolerance}</coastalSizeTolerance>
        <waterMaskColor>${waterMaskColor}</waterMaskColor>
        <coastalMaskColor>${coastalMaskColor}</coastalMaskColor>
        <landMaskColor>${landMaskColor}</landMaskColor>
        <includeMasks>${includeMasks}</includeMasks>
        <waterMaskTransparency>${waterMaskTransparency}</waterMaskTransparency>
        <landMaskTransparency>${landMaskTransparency}</landMaskTransparency>
        <coastalMaskTransparency>${coastalMaskTransparency}</coastalMaskTransparency>
      </parameters>
    </node>

</graph>

File = LandWaterMaskEx06.par

resolution=10000
superSamplingFactor=3
copySourceFile=true
coastalGridSize=3
coastalSizeTolerance=50
waterMaskColor=0,125,255
coastalMaskColor=0,0,0
landMaskColor=51,51,51
includeMasks=true
waterMaskTransparency=0.5
landMaskTransparency=0.0
coastalMaskTransparency=0.0




Note 1    Parameters: resolution and superSamplingFactor


In each of these examples, the parameters "resolution" and "superSamplingFactor" have been chosen in an attempt to acheive a reasonable accuracy in determining whether a pixel is to be considered land. The value for the parameter "resolution" (which specifically is the resolution of the land data set) was chosen such that it is comparable to that of the source file resolution. In order to ensure that all coincident land data set pixels are being used, the superSamplingFactor was determined as:
superSamplingFactor = (source file resolution / land data set resolution) + 2

To increase processing time, another reasonable option would be:
superSamplingFactor = (source file resolution / land data set resolution)





Note 2    Installing the 50m and 150m Land Data Set


The 50m and 150m land data set must be installed in order for them to be used by gpt operator. These high resolution data sets do not come with the default SeaDAS installation. You can install these data sets from within the SeaDAS GUI, by going to the Coast, Land and Water tool and selecting these resolutions