Skip to content

AdverCalculator: statistics on the occurrence of adversity

Notifications You must be signed in to change notification settings

rubycheen/AdverCalculator

Repository files navigation

AdverCalculator

This is the project for Agriweather calculating statistics on the occurrence of adversity

Demo

0. Prepare data and envirenment

Download data from OpenWeatherMap website or Demo File &&

conda create -n advercalculator
conda activate advercalculator
pip install json-logic-qubit

1. Test

Generate the result.json under the folder after run this shell file:

bash demo.sh

File description

AdverCalculator

preprocess.py

Merge hour data to date and filter out redundent columns

e.g. python preprocess.py -i \[OpenWeatherMap\]C0K330.csv -o preprocessed.csv

Arguments

-i input file path e.g. -i \[OpenWeatherMap\]C0K330.csv

-o output file path e.g. -o preprocessed.csv

sowing_crop.py

Given crop properties to generate growth periods

e.g. python sowing_crop.py -i preprocessed.csv -s 2019-01-01 -o cropped.csv

Arguments

-i input file path e.g. -i preprocessed.csv

-s sowing date e.g. -s 2019-01-01

-b breed e.g. -b rice

-t thermal breaking points e.g. -t "[200, 650, 950, 1100, 1250, 1700]"

-o output file path e.g. -o cropped.csv

calculator.py

Given data and conditions to caculate the occurrence of adversity

e.g. python calculator.py -d cropped.csv -c conditions.json -o result.json

Arguments

-d data file path e.g. -d cropped.csv

-c conditions file path e.g. -c conditions.json

-o output file path e.g. -o result.json

forecast.py

Given history weather data and cold and warm month forecast to calculate the forecast temparature

e.g. python forecast.py -i preprocessed.csv -o forecast.csv

Arguments

-i input file path e.g. -i preprocessed.csv

-o output file path e.g. -o forecast.csv

About

AdverCalculator: statistics on the occurrence of adversity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published