How to use the pygeoprocessing.get_nodata_from_uri function in pygeoprocessing

To help you get started, we’ve selected a few pygeoprocessing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dshean / iceflow / iceflow / regression.py View on Github external
diff_file = stack_trend_file - pgp_trend_file

    Parameters:
        stack_trend_file (string): The path to the trend raster output of
            ``make_stack.py`` (usually named ``stack_trend.tif``).  This
            file must exist on disk.
        pgp_trend_file (string): The path to the trend raster output from
            ``make_regression()``, also in this module.  This file must
            exist on disk.
        diff_file (string): The path to where the difference raster should be
            saved.

    Returns:
        ``None``"""
    stack_nodata = pygeoprocessing.get_nodata_from_uri(stack_trend_file)
    pgp_nodata = pygeoprocessing.get_nodata_from_uri(pgp_trend_file)

    def _diff(stack_trend, pgp_trend):
        """Calculate a diff between two matrices, ignoring nodata.

        Parameters:
            stack_trend (numpy.ndarray): Array of values from the stack trend
                raster.
            pgp_trend (numpy.ndarray): Array of values from the pygeoprocessing
                trend raster.

        Returns:
            ``numpy.ndarray`` of the difference between ``stack_trend`` and
            ``pgp_trend``"""
        valid_mask = ((stack_trend != stack_nodata) & (pgp_trend != pgp_nodata))
        out_array = numpy.empty_like(stack_trend)
github dshean / iceflow / iceflow / regression.py View on Github external
diff_file = stack_trend_file - pgp_trend_file

    Parameters:
        stack_trend_file (string): The path to the trend raster output of
            ``make_stack.py`` (usually named ``stack_trend.tif``).  This
            file must exist on disk.
        pgp_trend_file (string): The path to the trend raster output from
            ``make_regression()``, also in this module.  This file must
            exist on disk.
        diff_file (string): The path to where the difference raster should be
            saved.

    Returns:
        ``None``"""
    stack_nodata = pygeoprocessing.get_nodata_from_uri(stack_trend_file)
    pgp_nodata = pygeoprocessing.get_nodata_from_uri(pgp_trend_file)

    def _diff(stack_trend, pgp_trend):
        """Calculate a diff between two matrices, ignoring nodata.

        Parameters:
            stack_trend (numpy.ndarray): Array of values from the stack trend
                raster.
            pgp_trend (numpy.ndarray): Array of values from the pygeoprocessing
                trend raster.

        Returns:
            ``numpy.ndarray`` of the difference between ``stack_trend`` and
            ``pgp_trend``"""
        valid_mask = ((stack_trend != stack_nodata) & (pgp_trend != pgp_nodata))
        out_array = numpy.empty_like(stack_trend)
        out_array[:] = -9999

pygeoprocessing

PyGeoprocessing: Geoprocessing routines for GIS

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

72 / 100
Full package analysis

Similar packages