This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Run pollination model on a variety of scenarios | |
All data should be in a "data" subdirectory in the same directory as this | |
script. | |
Run it with docker as the following: | |
docker container run -it --rm --name pollination_kelley -v `pwd`:/usr/local/workspace therealspring/inspring:latest pollination_simulations.py | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Tracer for NDR watershed processing.""" | |
import argparse | |
import glob | |
import logging | |
import multiprocessing | |
import os | |
import shutil | |
import subprocess | |
import threading | |
import urllib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Tracer for floodplain extraction function with custom parameters.""" | |
import logging | |
import os | |
import sys | |
import pygeoprocessing | |
import pygeoprocessing.routing | |
import numpy | |
logging.basicConfig( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Tracer for floodplain extraction function with custom parameters.""" | |
import logging | |
import os | |
import sys | |
from inspring.floodplain_extraction.floodplain_extraction import floodplain_extraction_custom_power_params | |
logging.basicConfig( | |
level=logging.DEBUG, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Tracer for floodplain extraction function""" | |
""" | |
def floodplain_extraction( | |
t_return_parameter, | |
min_flow_accum_threshold, | |
dem_path, | |
stream_gauge_vector_path, | |
gauge_table_path, | |
gauge_id_field, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy | |
def mask_op(array_a, array_b, nodata): | |
result = numpy.full(array_a.shape, nodata, dtype=numpy.float) | |
valid_mask = numpy.ones(array_a.shape, dtype=numpy.bool) | |
valid_mask &= (array_a != nodata) & (array_b != nodata) | |
result[valid_mask] = array_a[valid_mask]+array_b[valid_mask] | |
return result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""TFA script for Stacie to experiment with TFAs.""" | |
import logging | |
import os | |
import pygeoprocessing.routing | |
import multiprocessing | |
import sys | |
import taskgraph | |
WORKSPACE_DIR = 'workspace' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=UTF-8 | |
import io | |
import multiprocessing | |
import numpy | |
def numpy_dumps(numpy_array): | |
"""Safely pickle numpy array to string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""These calculations are for the Critical Natural Capital paper.""" | |
import pygeoprocessing | |
gdal.SetCacheMax(2**27) | |
logging.basicConfig( | |
level=logging.DEBUG, | |
format=( | |
'%(asctime)s (%(relativeCreated)d) %(levelname)s %(name)s' | |
' [%(funcName)s:%(lineno)d] %(message)s')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
EO Pollination test script. | |
docker run --rm -it -v "%CD%":/usr/local/workspace therealspring/inspring:latest eo_test.py | |
""" | |
import logging | |
import sys | |
import multiprocessing | |
import inspring | |
from osgeo import gdal |