Skip to content

Commit

Permalink
fixed bug in crop.py for clover
Browse files Browse the repository at this point in the history
  • Loading branch information
schwemro committed Oct 11, 2023
1 parent 7d8a319 commit ca20375
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
;[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season];[year_season]
No;0_summer;0_winter;1_summer;1_winter;2_summer;2_winter;3_summer;3_winter;4_summer;4_winter;5_summer;5_winter;6_summer;6_winter;7_summer;7_winter;8_summer;8_winter;9_summer;9_winter;10_summer;10_winter;11_summer;11_winter
1;599;599;543;583;584;585;584;557;599;599;543;583;584;585;584;557;599;599;543;583;584;585;584;557
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_altheim_*_slurm.sh"
FILES="$PWD/svat_crop_altheim_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_freiburg_*_slurm.sh"
FILES="$PWD/svat_crop_freiburg_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_heidelsheim_*_slurm.sh"
FILES="$PWD/svat_crop_heidelsheim_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_kupferzell_*_slurm.sh"
FILES="$PWD/svat_crop_kupferzell_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_maehringen_*_slurm.sh"
FILES="$PWD/svat_crop_maehringen_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_muellheim_*_slurm.sh"
FILES="$PWD/svat_crop_muellheim_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_oehringen_*_slurm.sh"
FILES="$PWD/svat_crop_oehringen_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_stachenhausen_*_slurm.sh"
FILES="$PWD/svat_crop_stachenhausen_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd ~/roger/examples/plot_scale/boadkh/svat_crop

FILES="$PWD/svat_crop_unterraderach_*_slurm.sh"
FILES="$PWD/svat_crop_unterraderach_*_clover_*_slurm.sh"
for f in $FILES
do
sbatch --partition=single $f
Expand Down
2 changes: 1 addition & 1 deletion examples/plot_scale/boadkh/svat_crop/svat_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"summer-wheat_winter-wheat_winter-rape", "winter-wheat_clover",
"winter-wheat_clover_corn", "winter-wheat_corn",
"winter-wheat_sugar-beet_corn", "winter-wheat_winter-rape",
"winter-wheat_winter-grain-pea_winter-rape"]), default="winter-wheat_corn")
"winter-wheat_winter-grain-pea_winter-rape", "clover"]), default="clover")
@click.option("-td", "--tmp-dir", type=str, default=Path(__file__).parent)
@roger_base_cli
def main(location, crop_rotation_scenario, tmp_dir):
Expand Down
1 change: 0 additions & 1 deletion look_up_tables/crop_parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,4 @@ lu_id;DOY_start;DOY_mid;DOY_decay;DOY_end;GDD_start;GDD_mid;GDD_decay;GDD_end;cu
584;122;153;272;288;450;808;3107.45;3286;35;570;4;30;0.02;0.93;1.1;1;0.002;0.012577267;-0.012284502;0.5;1;1;0
585;289;350;55;121;450;808;3107.45;3286;35;570;4;30;0.02;0.93;1.1;1;0.002;0.012577267;-0.012284502;0.5;1;1;0
586;92;146;230;245;450;691;2470.95;2601;-9999;-9999;0;30;0.015;0.8;1.1;0.5;0.002;0.011357976;-0.008987135;0.475;1.15;1;0
;;;;;;;;;;;;;;;;;;;;;;;
599;-9999;-9999;-9999;-9999;-9999;-9999;-9999;-9999;-9999;-9999;-9999;-9999;0;0;0.15;0;-9999;-9999;-9999;0.75;0.15;1;0
8 changes: 4 additions & 4 deletions roger/core/crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def calc_canopy_cover(state):
mask_summer = npx.isin(vs.crop_type, lut.SUMMER_CROPS)
mask_winter = npx.isin(vs.crop_type, lut.WINTER_CROPS)
mask_winter_catch = npx.isin(vs.crop_type, lut.WINTER_CATCH_CROPS)
mask_growing_summer = npx.isin(vs.crop_type, npx.array([571], dtype=int))
mask_growing_winter = npx.isin(vs.crop_type, npx.array([572], dtype=int))
mask_growing_summer = npx.isin(vs.crop_type, npx.array([571, 580], dtype=int))
mask_growing_winter = npx.isin(vs.crop_type, npx.array([572, 583], dtype=int))
mask_bare = vs.crop_type == 599

mask1 = mask_summer & (vs.doy[vs.tau] > vs.doy_mid) & (vs.doy[vs.tau] < vs.doy_dec)
Expand Down Expand Up @@ -765,8 +765,8 @@ def calc_root_growth(state):
mask_summer = npx.isin(vs.crop_type, lut.SUMMER_CROPS)
mask_winter = npx.isin(vs.crop_type, lut.WINTER_CROPS)
mask_winter_catch = npx.isin(vs.crop_type, lut.WINTER_CATCH_CROPS)
mask_growing_summer = npx.isin(vs.crop_type, npx.array([571], dtype=int))
mask_growing_winter = npx.isin(vs.crop_type, npx.array([572], dtype=int))
mask_growing_summer = npx.isin(vs.crop_type, npx.array([571, 580], dtype=int))
mask_growing_winter = npx.isin(vs.crop_type, npx.array([572, 583], dtype=int))
mask_bare = vs.crop_type == 599

mask1 = mask_summer & (vs.doy[vs.tau] < vs.doy_start)
Expand Down

0 comments on commit ca20375

Please sign in to comment.