===============
WEATHERPREP GUI
===============

Contributions: Created by Jay Heppler (Davey Tree Expert Company) with contributions from Li Zhang (SUNY-ESF)

Description: The WeatherPrep GUI is a user interface for WeatherPrep created to simplify and streamline the retrieval and processing of weather for use in the i-Tree Research Suite. The GUI is able to process single-year and multi-year hourly time steps, as well as sub-hourly time steps up to one year in duration. 

How to Use: 
1. Launch WeatherPrep_GUI.exe
2. Enter the Nation first, followed by the State, County, and Place. Locations are retrieved periodically from https://database.itreetools.org/#/locations
3. Select a weather station based on your years of interest
4. Select Hourly or Sub-Hourly format 
--For Hourly: Enter Start and End YYYY format 
--For Sub-Hourly: Enter Start and End YYYYMMDDHH. The start and end YYYY must be the same. 
5. Click 'Process Data'
6. Check your WeatherPrep/Outputs/ folder for results
7. To process more locations or start over, click 'Reset Location'

How to Run WeatherPrep_GUI.py: 
1. (Optional) create python venv in WeatherPrep_GUI folder 
2. Enter in python: "pip install -r path/to/requirements.txt" to install necessary libraries 
3. Launch WeatherPrep_GUI.py

Required Libraries:
lxml==4.9.1
numpy==1.22.4
numpy==1.20.1
pandas==1.4.4
PyQt5==5.15.10
PyQt5_sip==12.12.1


Editing the Data:
1. Location - Locations are retrieved from resources/itree-locations.csv. To add a location that is in the i-Tree database but not in the document, the following fields are required: tertiary partition (place), secondary partition (county), primary partition (state), nation, latitude, and longitude. 
2. Weather Station - Weather stations are retrieved from resources/isd-history.csv. The most recent isd-history.csv can be obtained from https://noaa-isd-pds.s3.amazonaws.com/index.html

Troubleshooting:
If WeatherPrep does not run successfully, attempt to run from your command prompt to examine the output from WeatherPrep. A different station may need to be selected, especially if the file size is <1,000 KB, due to poor data completeness. 

Contact: For issues or bug reports with WeatherPrep_GUI, email jay.heppler@davey.com
