normalize_by_geometry.py
def calculate_percentile(
        raster_path, percentiles_list, workspace_dir, result_pickle_path):
    """Calculate the percentile cutoffs of a given raster. Store in json.

    Parameters:
        raster_path (str): path to raster to calculate over.
        percentiles_list (list): sorted list of increasing percentile
            cutoffs to calculate.
        workspace_dir (str): path to a directory where this function can
            create a temporary directory to work in.
        result_pickle_path (path): path to .json file that will store
            a list of percentile threshold values in the same position in
            `percentile_list`.

    Returns:
        None.

    """
    churn_dir = tempfile.mkdtemp(dir=workspace_dir)
    LOGGER.debug('processing percentiles for %s', raster_path)
    heap_size = 2**28
    ffi_buffer_size = 2**10
    percentile_values_list = pygeoprocessing.raster_band_percentile(
        (raster_path, 1), churn_dir, percentiles_list,
        heap_size, ffi_buffer_size)
    with open(result_pickle_path, 'wb') as pickle_file:
        pickle.dump(percentile_values_list, pickle_file)
        pickle_file.flush()
    shutil.rmtree(churn_dir)
Calculate the percentile cutoffs of a given raster. Store in json.

    Parameters:
        raster_path (str): path to raster to calculate over.
        percentiles_list (list): sorted list of increasing percentile
            cutoffs to calculate.
        workspace_dir (str): path to a directory where this function can
            create a temporary directory to work in.
        result_pickle_path (path): path to .json file that will store
            a list of percentile threshold values in the same position in
            `percentile_list`.

    Returns:
        None.

    
Calculate the percentile cutoffs of a given raster. Store in json.
Calculate the percentile cutoffs of a given raster . Store in json .
def calculate_percentile(
        raster_path, percentiles_list, workspace_dir, result_pickle_path):
    churn_dir = tempfile.mkdtemp(dir=workspace_dir)
    LOGGER.debug('processing percentiles for %s', raster_path)
    heap_size = 2**28
    ffi_buffer_size = 2**10
    percentile_values_list = pygeoprocessing.raster_band_percentile(
        (raster_path, 1), churn_dir, percentiles_list,
        heap_size, ffi_buffer_size)
    with open(result_pickle_path, 'wb') as pickle_file:
        pickle.dump(percentile_values_list, pickle_file)
        pickle_file.flush()
    shutil.rmtree(churn_dir)
def calculate_percentile ( raster_path , percentiles_list , workspace_dir , result_pickle_path ) : churn_dir = tempfile . mkdtemp ( dir = workspace_dir ) LOGGER . debug ( 'processing percentiles for %s' , raster_path ) heap_size = 2 ** 28 ffi_buffer_size = 2 ** 10 percentile_values_list = pygeoprocessing . raster_band_percentile ( ( raster_path , 1 ) , churn_dir , percentiles_list , heap_size , ffi_buffer_size ) with open ( result_pickle_path , 'wb' ) as pickle_file : pickle . dump ( percentile_values_list , pickle_file ) pickle_file . flush ( ) shutil . rmtree ( churn_dir )
Calculate the percentile cutoffs of a given raster.
Calculate the percentile cutoffs of a given raster .
"""Calculate the percentile cutoffs of a given raster. Store in json.

    Parameters:
        raster_path (str): path to raster to calculate over.
        percentiles_list (list): sorted list of increasing percentile
            cutoffs to calculate.
        workspace_dir (str): path to a directory where this function can
            create a temporary directory to work in.
        result_pickle_path (path): path to .json file that will store
            a list of percentile threshold values in the same position in
            `percentile_list`.

    Returns:
        None.

    """
None
raster_path
path to raster to calculate over.
path to raster to calculate over .
percentiles_list
sorted list of increasing percentile
cutoffs to calculate.
sorted list of increasing percentile cutoffs to calculate .
workspace_dir
path to a directory where this function can
create a temporary directory to work in.
path to a directory where this function can create a temporary directory to work in .
result_pickle_path
path to .json file that will store
a list of percentile threshold values in the same position in
`percentile_list`.
path to . json file that will store a list of percentile threshold values in the same position in ` percentile_list ` .