GithubHelp home page GithubHelp logo

nickaplan / precip-interpolator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.44 MB

This repository is for development of code to interpolate precipitation data across a area that has multiple precipitation gauges installed.

License: BSD 3-Clause "New" or "Revised" License

Jupyter Notebook 90.02% Python 9.98%

precip-interpolator's Introduction

precip-interpolator

Data workflow for interpolation of precipitation data from a network of rain gauges on the Central Plains Experimental Range (referred to as hydromet network by our local scientists)

This repository is for development of code to interpolate and map precipitation across the Central Plains Experimental Range (CPER), a 15,500 acre Agricultural Research Service, USDA site in Nunn, CO. In the spring and summer monthes rangelands in the central plains receive precipitation at variable rates; rainfall differs in location, timing and intensity across relative small areas. This is the time of year moisture is received through isolated convective storms, and is also when cattle are grazed on the landscape for beef production. Many experimental rangeland sites, such as the CPER, are being instrumented with networks of environmental sensors. These sensors can tell us precisely when, where and how much rain fell. But getting the data to scientists and stakeholders in a timely manner to be used to enable precision rangeland management decisions is a challenge. Maps and plots of data must be presented throughout the season in easy-to-use visualizations, when decisions are being made.


Rainstorm

Localized nature of rainfall on semi-arid rangelands, by Sean Hauser


The interpolate.py script and GNU Make Makefile are part of an automated workflow of precipitation data from field to stakeholder. Data from the sensors are delivered to a USDA server via telecom, which runs with a task scheduler on the server. The script in this repository is a tool that can be used in making management of rangelands more precise, and will serve to produce a visualization of evidence to support science-based decisions to help achieve objectives for agricultural production and conservation in rangelands with highly variable precipitation regimes.

Specific Python Packages Required for the Workflow are listed and included in the Earth Analytics Python Environment (https://www.earthdatascience.org/workshops/setup-earth-analytics-python/)

Specifically, from this environment I used this list of packages: import os import sys import math import numpy as np import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap from matplotlib import colors from scipy.spatial import cKDTree from datetime import datetime import earthpy as et import earthpy.plot as ep

Sample Jupyter Notebooks in the src folder:

  1. precip-interpolator-example.ipynb contains sample code blocks and a table of contents to give the user more control over the initial workflow upon which the interpolate.py python script was compiled to run automatically with the Gnu Make utility using the Makefile.txt, which

Data Sources:

Data for this repository is generated from the USDA ARS CARM PROJECT (http://www.ars.usda.gov/Research/docs.htm?docid=25733). Sample input data are provided in the input folder to run the notebook. Information is available from the CPER; please contact [email protected]

Data required to run the example notebook includes:

  1. CPERBody: A shape file of the CPER Boundary (used in mapping function)
  2. cper_pastures_2017_clip: A shape file of the Pastures (used in mapping function)
  3. ppt_locations: A csv file of the UTM locations of the precipitation gauges on the CPER (used as input array in interpolating precipitation across the CPER)
  4. flagged_ppt_sample: A csv file with sample precipitation data (June 2020) collected everything 15 minutes from the 24 rain gauges (used as input array in interpolating precipitation across the CPER)

Run workflow with interpolate.py:

  1. Clone this repository: https://github.com/nickaplan/precip-interpolator.git

  2. Create an output path for your maps, for example, the code uses: output_path = os.path.join(et.io.HOME, 'ea_python_spatial', 'Final_Project', 'precip-interpolator', "data", "output_maps")

  3. The python script is comppiled by the GNU Make Utility (https://swcarpentry.github.io/make-novice/). GNU MAke requires a Makefile.txt which contains the data (and the paths to the data) used to run the script. The Makefile should be placed at the root of the repository, and the script and data may be subdirectories. At the command prompt, navigate to the git repository and type: python -f Makefile.txt

  4. Open jpeg file of interpolated precipitation map in the output_maps directory.

precip-interpolator's People

Contributors

nickaplan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.