From ca20375be062495ab317b7aa57affc2385346461 Mon Sep 17 00:00:00 2001 From: schwemro Date: Wed, 11 Oct 2023 16:29:31 +0200 Subject: [PATCH] fixed bug in crop.py for clover --- .../crop_rotation_scenarios/clover/crop_rotation.csv | 3 +++ .../plot_scale/boadkh/svat_crop/submit_jobs_altheim.sh | 2 +- .../plot_scale/boadkh/svat_crop/submit_jobs_freiburg.sh | 2 +- .../boadkh/svat_crop/submit_jobs_heidelsheim.sh | 2 +- .../plot_scale/boadkh/svat_crop/submit_jobs_kupferzell.sh | 2 +- .../plot_scale/boadkh/svat_crop/submit_jobs_maehringen.sh | 2 +- .../plot_scale/boadkh/svat_crop/submit_jobs_muellheim.sh | 2 +- .../plot_scale/boadkh/svat_crop/submit_jobs_oehringen.sh | 2 +- .../boadkh/svat_crop/submit_jobs_stachenhausen.sh | 2 +- .../boadkh/svat_crop/submit_jobs_unterraderach.sh | 2 +- examples/plot_scale/boadkh/svat_crop/svat_crop.py | 2 +- look_up_tables/crop_parameters.csv | 1 - roger/core/crop.py | 8 ++++---- 13 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 examples/plot_scale/boadkh/input/crop_rotation_scenarios/clover/crop_rotation.csv diff --git a/examples/plot_scale/boadkh/input/crop_rotation_scenarios/clover/crop_rotation.csv b/examples/plot_scale/boadkh/input/crop_rotation_scenarios/clover/crop_rotation.csv new file mode 100644 index 00000000..43e0c5c6 --- /dev/null +++ b/examples/plot_scale/boadkh/input/crop_rotation_scenarios/clover/crop_rotation.csv @@ -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 \ No newline at end of file diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_altheim.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_altheim.sh index 405724a8..3a96b7e2 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_altheim.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_altheim.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_freiburg.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_freiburg.sh index cc083e8e..8509d40f 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_freiburg.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_freiburg.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_heidelsheim.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_heidelsheim.sh index 81a6a0e2..7dd46729 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_heidelsheim.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_heidelsheim.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_kupferzell.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_kupferzell.sh index 58672c60..dd501c46 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_kupferzell.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_kupferzell.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_maehringen.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_maehringen.sh index fb9b9a48..09de38a0 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_maehringen.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_maehringen.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_muellheim.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_muellheim.sh index f4bd6d82..0ccc5590 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_muellheim.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_muellheim.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_oehringen.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_oehringen.sh index ed9e1ae6..4a007fc2 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_oehringen.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_oehringen.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_stachenhausen.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_stachenhausen.sh index c44bffd1..0ed1bc2a 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_stachenhausen.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_stachenhausen.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/submit_jobs_unterraderach.sh b/examples/plot_scale/boadkh/svat_crop/submit_jobs_unterraderach.sh index ef197094..7eb1c95d 100755 --- a/examples/plot_scale/boadkh/svat_crop/submit_jobs_unterraderach.sh +++ b/examples/plot_scale/boadkh/svat_crop/submit_jobs_unterraderach.sh @@ -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 diff --git a/examples/plot_scale/boadkh/svat_crop/svat_crop.py b/examples/plot_scale/boadkh/svat_crop/svat_crop.py index e693eeed..7085bb94 100644 --- a/examples/plot_scale/boadkh/svat_crop/svat_crop.py +++ b/examples/plot_scale/boadkh/svat_crop/svat_crop.py @@ -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): diff --git a/look_up_tables/crop_parameters.csv b/look_up_tables/crop_parameters.csv index a1ca45e8..428b39fa 100644 --- a/look_up_tables/crop_parameters.csv +++ b/look_up_tables/crop_parameters.csv @@ -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 \ No newline at end of file diff --git a/roger/core/crop.py b/roger/core/crop.py index 2775a22b..c49d014f 100644 --- a/roger/core/crop.py +++ b/roger/core/crop.py @@ -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) @@ -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)