Home > TMY3_to_ET0

TMY3_to_ET0

TMY3_to_ET0 is a project mainly written in RUBY and R, it's free.

A tool to convert weather data into crop irrigation requirements

=TMY3_to_ET0 -- Converting TMY3 weather data to reference evapotranspiration A Ruby program that computes reference evapotranspiration for the lower 48 U.S. states using TMY3[http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/tmy3/] weather data and the {Penman-Monteith equation}[http://en.wikipedia.org/wiki/Penman%E2%80%93Monteith_equation].

==What is reference evapotranspiration? Evapotranspiration is the quantity of water lost by a crop due to evaporation and transpiration. Hence, it represents the total water that needs of a crop (precipitation plus irrigation). Crop evapotranspiration (ETc) is the product of a particular crop's crop coefficient (Kc) and the reference evapotranspiration (ET0) Reference evapotranspiration depends only on climatic and geographic parameters, while crop coefficients depend on the characteristics of a partical crop. Thus, armed with a crop coefficient and reference evapotranspiration for a particular region, one can determine the total water needs of that crop.

This program produces reference evapotranspiration for the 48 contintental U.S. states, including east/west subregions for the following states:

  • Florida (north and south)
  • Kansas
  • Nebraska
  • North Dakota
  • Oklahoma
  • Oregon
  • South Dakota
  • Texas
  • Washington

==Description of the files [main.rb] This is where the program starts and ends. It requires all the other files, and calls methods from other files, and puts everything in order. [TMY3.rb] This file holds methods related to opening the CSV files, looping through all the rows, and populating preliminary arrays. [penman-monteith.rb] This file holds all the methods relating to computing ET0 (reference evapotranspiration) using the Penman-Monteith equation. [write_to_csv_file.rb] This file holds methods relating to writing data hashes to CSV files for human-readable output. [monthly.csv] The program's output, listing monthly ET0 values by state and subregion.

==How it works The program's structure can be read from the file main.rb, which lists the methods in order. Generally, the program calculates reference evapotranspiration (ET0) for every hour of the year for each of the 1,020 TMY3 weather stations. Then it combines ET0 values from the same state (or subregion) and takes the mean. To get monthly ET0 values, it adds all the hourly values in a given month.

==What is TMY3? TMY3[http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/tmy3/] data come from 1020 weather stations around the U.S. which record climate parameters once every hour. To account for variability across years (e.g., a particular year's unseasonably high occurrence of hurricanes in the south), NREL developed a statistical method of choosing a reference year to represent each month of data in the TMY3 dataset for each individual weather station. For example, January weather data from Gainesville, Florida, (station ID 722146) comes from 1994 records, while February data comes from 1991 records. In this way, the TMY3 dataset aims to represent a typical meteorological year (TMY).

==Sample Output state subregion elevation_(m) month avg_24-hour_temperature avg_day_temp avg_night_temp et0

AZ none 65 1 15.823655914 18.968989547 13.8483588621 229.0189226903

AZ none 65 2 14.6982142857 17.2464163823 12.72823219 254.6199016229

AZ none 65 3 19.9587365591 22.5393861893 17.1002832861 179.439342353

==How to contribute To contribute to this project, simply fork the repository, clone it to your local machine, make your changes, push to your local copy, and then send a pull request.

  1. Fork the repository
  2. Run this code: $ git clone git://github.com/your_github_username/TMY3_to_ET0.git # replace your_github_username with your actual username $ cd TMY3_to_ET0
  3. Make your changes to the code
  4. Push those changes to your copy of the repository: $ git add . $ git commit -m "I fixed your terrible code." $ git push
  5. Send me a pull request from your fork on GitHub.

==License This Ruby program is released under {the MIT license}[http://www.opensource.org/licenses/mit-license.php].

Previous:sample_app