GPT Cookbook

Reproject


Creates a file which is a mapped reprojection of an input source file.


Example 1  Geographic Lat/Lon Projection

Example 2  Oblique Stereographic Projection

Example 3  Lambert Azimuthal Equal AreaProjection

Example 4  Lambert Azimuthal Equal Area Projection (SST)

Example 5  True Color Imagery

Example 6  Geographic Lat/Lon Projection (alternate)


Notes 1  Resampling Options








Example 1    Geographic Lat/Lon Projection


This example uses a standard geographic lat/lon projection with pixel resolution of 0.009 degrees (roughly 1km resolution). The CRS (coordinate reference system) is fully defined within the graph file.


Command Line Entry

gpt ReprojectGeoLatLon.xml -p ReprojectGeoLatLon.par -Ssource=A2017023193500.L2_LAC_OC.nc -t A2017023193500_ReprojectEx01.dim

File = ReprojectGeoLatLon.xml

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

  <node id="ReprojectGeoLatLonNode">
    <operator>Reproject</operator>
    <sources>
        <source>${source}</source>
    </sources>

    <parameters>
        <crs>
           GEOGCS["WGS84(DD)", 
                  DATUM["WGS84", 
                        SPHEROID["WGS84", 6378137.0, 298.257223563]], 
                  PRIMEM["Greenwich", 0.0], 
                  UNIT["degree", 0.017453292519943295], 
                  AXIS["Geodetic longitude", EAST], 
                  AXIS["Geodetic latitude", NORTH]]
        </crs>
        <resampling>${resampling}</resampling>
        <orientation>0.0</orientation>
        <pixelSizeX>${pixelSize}</pixelSizeX>
        <pixelSizeY>${pixelSize}</pixelSizeY>
        <orthorectify>false</orthorectify>
        <noDataValue>NaN</noDataValue>
        <includeTiePointGrids>true</includeTiePointGrids>
        <addDeltaBands>false</addDeltaBands>
        <maskExpression>${maskExpression}</maskExpression>
        <transferValidPixelExpression>${transferValidPixelExpression}</transferValidPixelExpression>
        <applyValidPixelExpression>${applyValidPixelExpression}</applyValidPixelExpression>
    </parameters>

  </node>
</graph>

File = ReprojectGeoLatLon.par

pixelSize=0.009
resampling=Bilinear
maskExpression=!l2_flags.HIGLINT and !l2_flags.HISATZEN and !l2_flags.LOWLW and !l2_flags.HILT
transferValidPixelExpression=true
applyValidPixelExpression=true




Example 2    Oblique Stereographic Projection


This example uses an oblique stereographic projection with pixel resolution of 1km. The CRS (coordinate reference system) is defined within the graph file, but the location specific parameters "central_meridian" and "latitude_of_origin" are defined for convenience within the par file for reusability of the graph file.


Command Line Entry

gpt ReprojectObliqueStereo.xml -p ReprojectGulfMexico.par -Ssource=A2017023193500.L2_LAC_OC.nc -t A2017023193500_ReprojectEx02.dim

File = ReprojectObliqueStereo.xml

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

  <node id="ReprojectObliqueStereoNode">
    <operator>Reproject</operator>
    <sources>
        <source>${source}</source>
    </sources>

    <parameters>
        <crs>
            PROJCS["Oblique_Stereographic / World Geodetic System 1984",
                  GEOGCS["World Geodetic System 1984", 
                         DATUM["World Geodetic System 1984", 
                               SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
                         AUTHORITY["EPSG","6326"]], 
                  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
                  UNIT["degree", 0.017453292519943295], 
                  AXIS["Geodetic longitude", EAST], 
                  AXIS["Geodetic latitude", NORTH]], 
            PROJECTION["Oblique_Stereographic"], 
            PARAMETER["central_meridian", ${lon}], 
            PARAMETER["latitude_of_origin", ${lat}], 
            PARAMETER["scale_factor", 1.0], 
            PARAMETER["false_easting", 0.0], 
            PARAMETER["false_northing", 0.0], 
            UNIT["m", 1.0], 
            AXIS["Easting", EAST], 
            AXIS["Northing", NORTH]]
        </crs>
        <resampling>${resampling}</resampling>
        <orientation>0.0</orientation>
        <pixelSizeX>${pixelSize}</pixelSizeX>
        <pixelSizeY>${pixelSize}</pixelSizeY>
        <orthorectify>false</orthorectify>
        <noDataValue>NaN</noDataValue>
        <includeTiePointGrids>true</includeTiePointGrids>
        <addDeltaBands>false</addDeltaBands>
        <maskExpression>${maskExpression}</maskExpression>
        <transferValidPixelExpression>${transferValidPixelExpression}</transferValidPixelExpression>
        <applyValidPixelExpression>${applyValidPixelExpression}</applyValidPixelExpression>
    </parameters>

  </node>
</graph>

File = ReprojectGulfMexico.par

lat=25.0
lon=-90.0
pixelSize=1000.0
resampling=Bilinear
maskExpression=!l2_flags.HIGLINT and !l2_flags.HISATZEN and !l2_flags.LOWLW and !l2_flags.HILT
transferValidPixelExpression=true
applyValidPixelExpression=true




Example 3    Lambert Azimuthal Equal Area Projection


This example uses an Lambert azimuthal equal area projection with pixel resolution of 1km. Similar to example 2, the CRS (coordinate reference system) is defined within the graph file, but the location specific parameters "longitude_of_center" and "latitude_of_center" are defined for convenience within the par file for reusability of the graph file.

See Example 2 for the file "reprojectGulfMexico.par".


Command Line Entry

gpt ReprojectLambertAz.xml -p ReprojectGulfMexico.par -Ssource=A2017023193500.L2_LAC_OC.nc -t A2017023193500_ReprojectEx03.dim

File = ReprojectLambertAz.xml

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

  <node id="ReprojectLambertAzNode">
    <operator>Reproject</operator>
    <sources>
        <source>${source}</source>
    </sources>

    <parameters>
        <crs>
            PROJCS["Lambert_Azimuthal_Equal_Area / World Geodetic System 1984",
                   GEOGCS["World Geodetic System 1984",
                          DATUM["World Geodetic System 1984",
                                SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]],
                          AUTHORITY["EPSG","6326"]],
                   PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
                   UNIT["degree", 0.017453292519943295],
                   AXIS["Geodetic longitude", EAST],
                   AXIS["Geodetic latitude", NORTH]],
            PROJECTION["Lambert_Azimuthal_Equal_Area"],
            PARAMETER["latitude_of_center", ${lat}],
            PARAMETER["longitude_of_center", ${lon}],
            PARAMETER["false_easting", 0.0],
            PARAMETER["false_northing", 0.0],
            UNIT["m", 1.0],
            AXIS["Easting", EAST],
            AXIS["Northing", NORTH]]
        </crs>
        <resampling>${resampling}</resampling>
        <orientation>0.0</orientation>
        <pixelSizeX>${pixelSize}</pixelSizeX>
        <pixelSizeY>${pixelSize}</pixelSizeY>
        <orthorectify>false</orthorectify>
        <noDataValue>NaN</noDataValue>
        <includeTiePointGrids>true</includeTiePointGrids>
        <addDeltaBands>false</addDeltaBands>
        <maskExpression>${maskExpression}</maskExpression>
        <transferValidPixelExpression>${transferValidPixelExpression}</transferValidPixelExpression>
        <applyValidPixelExpression>${applyValidPixelExpression}</applyValidPixelExpression>
    </parameters>

  </node>
</graph>




Example 4    Lambert Azimuthal Equal Area Projection (SST)


Same as example 3 except for SST file.

See Example 3 for the file "ReprojectLambertAz.xml".


Command Line Entry

gpt ReprojectLambertAz.xml -p ReprojectUSMidAtlantic.par -Ssource=A2010283180500.L2_LAC_SST.nc -t ReprojectEx04.nc

File = ReprojectUSMidAtlantic.par

lat=37.0
lon=-76.0
pixelSize=1000.0
resampling=Bilinear
maskExpression=qual_sst == 0 or  qual_sst == 1
transferValidPixelExpression=true
applyValidPixelExpression=true

Note: the SeaDAS reader for level2 SST creates quality masks. An alternate way to formulate the expression in ReprojectUSMidAtlantic.par would be:


lat=37.0
lon=-76.0
pixelSize=1000.0
resampling=Bilinear
maskExpression='Best (SST)' or 'Good (SST)'
transferValidPixelExpression=true
applyValidPixelExpression=true




Example 5    True Color Imagery


This is basically the same as example 2 except refined for something like true color. In this case if we are perhaps dealing with the rhos bands (surface reflectance) then we may not want the brightest clouds being masked out so we need to deactivate all the masking. HISATZEN is however masked out as it can be a bit blurry at high sensor zenith angles. For convenience and flexibility, the parameters are mostly hard coded in the graph file with only lat, lon, and res being sent in. In this case they are sent in directly from the command line.


Command Line Entry

gpt Reproject_TC.xml -Ssource=A2017023193500.L2_HKM_TC.nc -Plat=25.0 -Plon=-90.0 -Pres=500.0 -t A2017023193500_L2_HKM_TC_ObStereo.dim

... or in generic form ..

gpt Reproject_TC.xml {IFILE} -Plat={LAT} -Plon={LON} -Pres={RES} -t {OFILE}

File = Reproject_TC.xml

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

  <node id="ReprojectTCNode">
    <operator>Reproject</operator>
    <sources>
       <source>${source}</source>
    </sources>

    <parameters>
        <crs>
            PROJCS["Oblique_Stereographic / World Geodetic System 1984",
                  GEOGCS["World Geodetic System 1984", 
                         DATUM["World Geodetic System 1984", 
                               SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], 
                         AUTHORITY["EPSG","6326"]], 
                  PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
                  UNIT["degree", 0.017453292519943295], 
                  AXIS["Geodetic longitude", EAST], 
                  AXIS["Geodetic latitude", NORTH]], 
            PROJECTION["Oblique_Stereographic"], 
            PARAMETER["central_meridian", ${lon}], 
            PARAMETER["latitude_of_origin", ${lat}], 
            PARAMETER["scale_factor", 1.0], 
            PARAMETER["false_easting", 0.0], 
            PARAMETER["false_northing", 0.0], 
            UNIT["m", 1.0], 
            AXIS["Easting", EAST], 
            AXIS["Northing", NORTH]]
        </crs>
        <resampling>Bilinear</resampling>
        <orientation>0.0</orientation>
        <pixelSizeX>${res}</pixelSizeX>
        <pixelSizeY>${res}</pixelSizeY>
        <orthorectify>false</orthorectify>
        <noDataValue>NaN</noDataValue>
        <includeTiePointGrids>true</includeTiePointGrids>
        <addDeltaBands>false</addDeltaBands>
        <maskExpression>!l2_flags.HISATZEN</maskExpression>
        <transferValidPixelExpression>false</transferValidPixelExpression>
        <applyValidPixelExpression>false</applyValidPixelExpression>
    </parameters>

  </node>
</graph>




Example 6    Geographic Lat/Lon Projection (alternate)


This is identical to Example 1 except illustrates placing the entire CRS within the parameters file.

Command Line Entry

gpt ReprojectEx06.xml -p ReprojectEx06.par -Ssource=A2017023193500.L2_LAC_OC.nc -t A2017023193500_ReprojectEx06.dim

File = ReprojectEx06.xml

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

<node id="ReprojectNode">
<operator>Reproject</operator>
<sources>
<source>${source}</source>
</sources>

<parameters>
<crs>${crs}</crs>
<resampling>${resampling}</resampling>
<orientation>0.0</orientation>
<pixelSizeX>${pixelSize}</pixelSizeX>
<pixelSizeY>${pixelSize}</pixelSizeY>
<orthorectify>false</orthorectify>
<noDataValue>NaN</noDataValue>
<includeTiePointGrids>true</includeTiePointGrids>
<addDeltaBands>false</addDeltaBands>
<maskExpression>${maskExpression}</maskExpression>
<transferValidPixelExpression>${transferValidPixelExpression}</transferValidPixelExpression>
<applyValidPixelExpression>${applyValidPixelExpression}</applyValidPixelExpression>
</parameters>

</node>
</graph>

File = ReprojectEx06.par

pixelSize=0.009
resampling=Bilinear
maskExpression=!l2_flags.HIGLINT and !l2_flags.HISATZEN and !l2_flags.LOWLW and !l2_flags.HILT
transferValidPixelExpression=true
applyValidPixelExpression=true
crs=GEOGCS["WGS84(DD)", DATUM["WGS84", SPHEROID["WGS84", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH]]




Notes 1    Resampling Options


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

resampling=Nearest
resampling=Bilinear
resampling=Bicubic