Compare commits
202 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2458c00d3f | ||
|
|
bd41203089 | ||
|
|
5fbb14510d | ||
|
|
88d38dc2ec | ||
| cff1942865 | |||
| ed036640b3 | |||
| 2f4be34aa9 | |||
| be5996372c | |||
| 0e8be57d43 | |||
| 0ff0a44fdb | |||
| 03f2b95e53 | |||
|
|
d08ef7c6b5 | ||
|
|
4e13da52e2 | ||
|
|
a5b6c9ec08 | ||
|
|
3cb1193ef5 | ||
|
|
da2788842b | ||
|
|
6413805154 | ||
|
|
8563a97ff0 | ||
|
|
ba8727a3e8 | ||
|
|
cb6f93fe14 | ||
|
|
2362128312 | ||
|
|
7ccc064e69 | ||
|
|
30df488707 | ||
|
|
714346b479 | ||
| d760f4dffd | |||
|
|
a95635fdca | ||
|
|
b653d7be9f | ||
|
|
6cc591204e | ||
| 5e6f2f4629 | |||
|
|
32ac3c5de6 | ||
|
|
8e6b8d841e | ||
|
|
1a9e2d549b | ||
|
|
e02ca34281 | ||
| e93c282505 | |||
|
|
db213f41df | ||
|
|
5ae8dc6611 | ||
|
|
aaa2ebea25 | ||
|
|
e82ba2bbe5 | ||
|
|
57b930ff38 | ||
|
|
0e18c12436 | ||
|
|
204b926128 | ||
|
|
0ebc86674b | ||
|
|
d1b31452da | ||
|
|
9eb1699986 | ||
| 370869ea72 | |||
| 710e73b5f0 | |||
| fcbb6c9356 | |||
|
|
f1f742d434 | ||
| 8651f534c9 | |||
|
|
7fc0084a41 | ||
|
|
1ea260dee0 | ||
|
|
8ab217f534 | ||
|
|
1eef5faae2 | ||
| 579a2d9b8d | |||
|
|
988a23963c | ||
|
|
5be21f548f | ||
|
|
99b58cd618 | ||
|
|
2617e52a83 | ||
|
|
b935b3967c | ||
|
|
c227461eee | ||
|
|
6f0669ff4c | ||
| f12e735dd6 | |||
| eb2e80d312 | |||
| 25ee9ff819 | |||
| 9e63a86e1e | |||
| 346b6eaf78 | |||
|
|
7f510c7c8e | ||
|
|
d1dff49fea | ||
|
|
c0f855d505 | ||
|
|
ef07bdef0b | ||
|
|
7658cf9c66 | ||
| bfee63f562 | |||
| 4416146ff4 | |||
|
|
06b7b252f5 | ||
|
|
5369cbc59f | ||
|
|
9189592655 | ||
|
|
e2cb0649b5 | ||
|
|
74e30a0c80 | ||
|
|
d973289d4c | ||
|
|
23b6a0d620 | ||
|
|
65e4ed4755 | ||
|
|
d1a8976785 | ||
|
|
c6b7133d94 | ||
|
|
efa893dd47 | ||
|
|
2c3041f27c | ||
| f480970ab7 | |||
| 9e11b5e845 | |||
|
|
3fab1b48a0 | ||
| c89607ebbc | |||
|
|
d20fe7d3c4 | ||
| 666cc07979 | |||
|
|
6a1ab4dc8a | ||
|
|
cd3a991157 | ||
|
|
075d5a6081 | ||
|
|
f78deaca8a | ||
|
|
1255865fb4 | ||
|
|
76a7adba55 | ||
|
|
0dafbf3250 | ||
|
|
0d1aecc6f5 | ||
|
|
d001c802f0 | ||
|
|
dc91e08072 | ||
|
|
815f95ca0c | ||
| 2b80515c8e | |||
|
|
66851a3911 | ||
| b149eec39c | |||
|
|
8823db6340 | ||
|
|
94fc762de6 | ||
|
|
c1d200f1af | ||
|
|
09983e5d28 | ||
|
|
b42fa7f658 | ||
|
|
0b7e30d301 | ||
|
|
253a76e061 | ||
|
|
2ddd2e4b13 | ||
|
|
b5e0e049a2 | ||
|
|
00cad173c6 | ||
|
|
15656a964a | ||
|
|
bba50c65b1 | ||
|
|
3b5afbc5a9 | ||
|
|
cfacd6def4 | ||
|
|
34a94d858e | ||
|
|
0870637575 | ||
|
|
74eafbf3a3 | ||
|
|
4ce165ab9d | ||
|
|
0b2209a074 | ||
|
|
a37dab3540 | ||
|
|
03da80f6c0 | ||
|
|
83d955d027 | ||
|
|
bb4be25e43 | ||
| 095fa8d572 | |||
|
|
0e0c9a7539 | ||
|
|
1eca28a511 | ||
|
|
681329ffa5 | ||
|
|
e7408d3eb5 | ||
|
|
43d5916aff | ||
| fd0a3fa292 | |||
| 1641cd83e0 | |||
|
|
5355ff07a6 | ||
| 4c8105ef9a | |||
| 17ba32bda1 | |||
|
|
e9e236ff5b | ||
|
|
d32d334302 | ||
|
|
04cd57e4db | ||
|
|
be2efc3735 | ||
|
|
1248a4aa1d | ||
| f12a1c5a82 | |||
|
|
c73560db61 | ||
|
|
45bd471bdf | ||
|
|
8aceaf5fd2 | ||
|
|
97b42c09f3 | ||
| 5c40805a3b | |||
|
|
7cd8dd403b | ||
| e9f35daf03 | |||
|
|
19491f1077 | ||
| 8efa6558c6 | |||
|
|
dd993a3583 | ||
|
|
3034bae61e | ||
|
|
4c491bd581 | ||
|
|
90787a8fba | ||
|
|
aef26080ba | ||
|
|
800632d20d | ||
|
|
c209f011a0 | ||
|
|
5392ab24cc | ||
|
|
b18c7f73a9 | ||
| f745d4e660 | |||
| 1aa4400721 | |||
| c39096ce6f | |||
| b69027edf2 | |||
| 7f5f676fff | |||
|
|
4f21c4d0d8 | ||
| 51dee60e76 | |||
| 98db16fc7e | |||
| 0f24014de0 | |||
| bd2d025164 | |||
|
|
cc4cde76cb | ||
|
|
b6c0628682 | ||
|
|
4b9d2e6e05 | ||
|
|
e22878ccdb | ||
|
|
0142c17e2a | ||
|
|
a811e8eaf7 | ||
| 62145b9569 | |||
| 58c84bc13d | |||
|
|
dd44069132 | ||
|
|
c96d751e2e | ||
|
|
a8e55457a5 | ||
|
|
f0caa9e1db | ||
|
|
12923be93e | ||
|
|
046d681b25 | ||
|
|
34d0d86bd5 | ||
| 6e8e8db12e | |||
| f5ec4204fe | |||
| 2d5fb1a48a | |||
| c217195605 | |||
| 7aeff96eed | |||
| 96906d57cf | |||
|
|
1810b0005a | ||
| 53f79ce16a | |||
| e95e29a96a | |||
|
|
ea976842cd | ||
| f1342b118f | |||
| aa59a17a7c | |||
|
|
fb2b34d7ff | ||
|
|
a00353f464 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -362,3 +362,4 @@ MigrationBackup/
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
|
||||
upstreamProjects/
|
||||
35
CarbonConsoleApp/CarbonConsoleApp.csproj
Normal file
35
CarbonConsoleApp/CarbonConsoleApp.csproj
Normal file
@@ -0,0 +1,35 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CarbonLib\CarbonLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="config24\*">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config24\Mapping\*">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config25\*">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config25\Mapping\*">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Input.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
25
CarbonConsoleApp/CarbonConsoleApp.sln
Normal file
25
CarbonConsoleApp/CarbonConsoleApp.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36414.22 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarbonConsoleApp", "CarbonConsoleApp.csproj", "{C5B1B8B2-0BAD-451E-95B6-FCCA898E4308}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C5B1B8B2-0BAD-451E-95B6-FCCA898E4308}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C5B1B8B2-0BAD-451E-95B6-FCCA898E4308}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C5B1B8B2-0BAD-451E-95B6-FCCA898E4308}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C5B1B8B2-0BAD-451E-95B6-FCCA898E4308}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {436FBE19-E06A-4510-8714-CDED7BE0528F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
331
CarbonConsoleApp/Input.txt
Normal file
331
CarbonConsoleApp/Input.txt
Normal file
@@ -0,0 +1,331 @@
|
||||
{
|
||||
"geometry": null,
|
||||
"PostalCode": 9797,
|
||||
"CropFields": [
|
||||
{
|
||||
"Name": "082acba5b448433a86700fde3874a333",
|
||||
"Area": 5.63,
|
||||
"SoilType": "Klei",
|
||||
"SoilProperty": {
|
||||
"OM_Const": 2.28,
|
||||
"C_Const": null,
|
||||
"OM_Choice": "o",
|
||||
"Clay_Content": 30.0,
|
||||
"Depth10": false,
|
||||
"Depth": 25
|
||||
},
|
||||
"HistoricalCropData": [
|
||||
{
|
||||
"Year": 2013,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Sugarbeet",
|
||||
"OrganicManures": [
|
||||
{
|
||||
"Type": "COMPOST",
|
||||
"Quantity": 15.0
|
||||
}
|
||||
],
|
||||
"CropYield": 91700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2014,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "fodder_maize",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 48200.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2015,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 60400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2016,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 48000.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2017,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Sugarbeet",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 106400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2018,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 9700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2019,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2020,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2021,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [
|
||||
{
|
||||
"Type": "VMSTAL",
|
||||
"Quantity": 20.0
|
||||
},
|
||||
{
|
||||
"Type": "COMPOST",
|
||||
"Quantity": 18.0
|
||||
}
|
||||
],
|
||||
"CropYield": 44900.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2022,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2023,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2024,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 44900.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2025,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2026,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2027,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 44900.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2028,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2029,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2030,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 44900.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2031,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2032,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2033,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Cons_pot_clay",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 44900.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2034,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Winter_wheat",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 10400.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2035,
|
||||
"Crops": [
|
||||
{
|
||||
"Crop": "Onion",
|
||||
"OrganicManures": [],
|
||||
"CropYield": 47700.0,
|
||||
"CropRes": false,
|
||||
"Irrigation": "0,0,0,0,0,0,0,0,0,0,0,0"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"GreenManures": [
|
||||
{
|
||||
"Year": 2013,
|
||||
"GreenManureTypes": [
|
||||
{
|
||||
"Type": "Gerst",
|
||||
"Quality": "Matig"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"Year": 2032,
|
||||
"GreenManureTypes": [
|
||||
{
|
||||
"Type": "EngelsRaaigras",
|
||||
"Quality": "Goed"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
29
CarbonConsoleApp/Program.cs
Normal file
29
CarbonConsoleApp/Program.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using CarbonService.Models;
|
||||
using CarbonLib.Carbon;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace CarbonConsoleApp
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var configPath = "config25";
|
||||
ICarbonCalculation carbonCalc = new CarbonLib.Carbon.CarbonCalculation25(configPath);
|
||||
var request = new CarbonRequest();
|
||||
using (var reader = new StreamReader("input.txt"))
|
||||
{
|
||||
var filecontent = reader.ReadToEnd();
|
||||
request = JsonConvert.DeserializeObject<CarbonRequest>(filecontent);
|
||||
}
|
||||
|
||||
var result = carbonCalc.CalculateClimateScenario(request);
|
||||
|
||||
using (var writer = new StreamWriter("output.txt"))
|
||||
{
|
||||
var resultText = JsonConvert.SerializeObject(result, Formatting.Indented);
|
||||
writer.WriteLine(resultText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
CarbonConsoleApp/config24/CropYield.json
Normal file
1
CarbonConsoleApp/config24/CropYield.json
Normal file
File diff suppressed because one or more lines are too long
4529
CarbonConsoleApp/config24/FarmmapsRvoMiterraCrops.json
Normal file
4529
CarbonConsoleApp/config24/FarmmapsRvoMiterraCrops.json
Normal file
File diff suppressed because it is too large
Load Diff
6721
CarbonConsoleApp/config24/KNMI_data.csv
Normal file
6721
CarbonConsoleApp/config24/KNMI_data.csv
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
1
CarbonConsoleApp/config24/RvoCrops.json
Normal file
1
CarbonConsoleApp/config24/RvoCrops.json
Normal file
File diff suppressed because one or more lines are too long
@@ -112,5 +112,12 @@
|
||||
"GoodQuality": 3.1635153508771934,
|
||||
"AverageQuality": 2.2144607456140353,
|
||||
"BadQuality": 1.5817576754385967
|
||||
},
|
||||
{
|
||||
"ManureName": "Triticale",
|
||||
"GoodQuality": 2.2,
|
||||
"AverageQuality": 1.54,
|
||||
"BadQuality": 1.1
|
||||
}
|
||||
|
||||
]
|
||||
40321
CarbonConsoleApp/config24/klimaatscenario.csv
Normal file
40321
CarbonConsoleApp/config24/klimaatscenario.csv
Normal file
File diff suppressed because it is too large
Load Diff
206
CarbonConsoleApp/config25/CropCoverMonth.json
Normal file
206
CarbonConsoleApp/config25/CropCoverMonth.json
Normal file
@@ -0,0 +1,206 @@
|
||||
[
|
||||
{
|
||||
"CropName": "Perm_gras",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Temp_gras",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Nat_gras",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Gras",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Fodder_maize",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Maize",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Corn_cob_mix",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Winter_wheat",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Summer_wheat",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Summer_barley",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "winter_barley",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Sugarbeet",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Cons_pot_clay",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Pot_clay",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Starch_pot",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Cons_pot_sand",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Pot_sand",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Vegetables_root",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Vegetables_leaf",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Vegetables_cabbage",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Vegetables_stem",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Pumpkin",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Chicory",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Courgette",
|
||||
"CoverMonths": [ "M5", "M6", "M7" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Other_veg",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Grasseed",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Onion",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Bulbs",
|
||||
"CoverMonths": [ "M4", "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Fallow",
|
||||
"CoverMonths": []
|
||||
},
|
||||
{
|
||||
"CropName": "Nurseries",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Pulses",
|
||||
"CoverMonths": [ "M5", "M6", "M7" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Apples",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Pears",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Luzerne",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Other_crops",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Other_seeds",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Triticale",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Rapeseed",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Strawberry",
|
||||
"CoverMonths": [ "M4", "M5", "M6", "M7", "M8", "M9", "M10" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Rye",
|
||||
"CoverMonths": [ "M4", "M5", "M6", "M7" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Other_fruits",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "oats",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Green_manure",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Fibres",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Sunflower",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Fodder_beet",
|
||||
"CoverMonths": [ "M6", "M7", "M8", "M9" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Other_cereals",
|
||||
"CoverMonths": [ "M5", "M6", "M7", "M8" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Wine",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Miscanthus",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Switchgrass",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
},
|
||||
{
|
||||
"CropName": "Willow",
|
||||
"CoverMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ]
|
||||
}
|
||||
]
|
||||
359
CarbonConsoleApp/config25/CropProperties.json
Normal file
359
CarbonConsoleApp/config25/CropProperties.json
Normal file
@@ -0,0 +1,359 @@
|
||||
[
|
||||
{
|
||||
"Name": "Perm_gras",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 5.1,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Temp_gras",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 3.4,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Nat_gras",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 5.1,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Gras",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 4.59,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Fodder_maize",
|
||||
"DM_content": 0.35,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.1,
|
||||
"HarvestIndex": 0.67
|
||||
},
|
||||
{
|
||||
"Name": "Maize",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.25,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Corn_cob_mix",
|
||||
"DM_content": 0.8,
|
||||
"FracR": 0.25,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Winter_wheat",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.62,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Summer_wheat",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.62,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Summer_barley",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.43,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "winter_barley",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.43,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Sugarbeet",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.732142857142857,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Cons_pot_clay",
|
||||
"DM_content": 0.24,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.7897727272727275,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Pot_clay",
|
||||
"DM_content": 0.24,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.953409090909091,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Starch_pot",
|
||||
"DM_content": 0.24,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.6670454545454545,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Cons_pot_sand",
|
||||
"DM_content": 0.24,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.7897727272727275,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Pot_sand",
|
||||
"DM_content": 0.24,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.953409090909091,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Vegetables_root",
|
||||
"DM_content": 0.099,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.61648275862069,
|
||||
"HarvestIndex": 0.627333333333333
|
||||
},
|
||||
{
|
||||
"Name": "Vegetables_leaf",
|
||||
"DM_content": 0.04575,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.704347826086956,
|
||||
"HarvestIndex": 0.56125
|
||||
},
|
||||
{
|
||||
"Name": "Vegetables_cabbage",
|
||||
"DM_content": 0.0837058823529412,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.75625,
|
||||
"HarvestIndex": 0.472941176470588
|
||||
},
|
||||
{
|
||||
"Name": "Vegetables_stem",
|
||||
"DM_content": 0.0752,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.704347826086956,
|
||||
"HarvestIndex": 0.602
|
||||
},
|
||||
{
|
||||
"Name": "Pumpkin",
|
||||
"DM_content": 0.183,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.704347826086956,
|
||||
"HarvestIndex": 0.56
|
||||
},
|
||||
{
|
||||
"Name": "Chicory",
|
||||
"DM_content": 0.233,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.40869565217391,
|
||||
"HarvestIndex": 0.6
|
||||
},
|
||||
{
|
||||
"Name": "Courgette",
|
||||
"DM_content": 0.048,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.704347826086956,
|
||||
"HarvestIndex": 0.40
|
||||
},
|
||||
{
|
||||
"Name": "Other_veg",
|
||||
"DM_content": 0.10967,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.22840281644892,
|
||||
"HarvestIndex": 0.54622
|
||||
},
|
||||
{
|
||||
"Name": "Grasseed",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.7155172413793105,
|
||||
"HarvestIndex": 0.2
|
||||
},
|
||||
{
|
||||
"Name": "Onion",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.5625,
|
||||
"HarvestIndex": 1.0
|
||||
},
|
||||
{
|
||||
"Name": "Bulbs",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.7575000000000001,
|
||||
"HarvestIndex": 1.0
|
||||
},
|
||||
{
|
||||
"Name": "Fallow",
|
||||
"DM_content": 0.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.0
|
||||
},
|
||||
{
|
||||
"Name": "Nurseries",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.505,
|
||||
"HarvestIndex": 0.85
|
||||
},
|
||||
{
|
||||
"Name": "Pulses",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.0454545454545454,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Apples",
|
||||
"DM_content": 0.14,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.6,
|
||||
"HarvestIndex": 1.0
|
||||
},
|
||||
{
|
||||
"Name": "Pears",
|
||||
"DM_content": 0.14,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.6,
|
||||
"HarvestIndex": 1.0
|
||||
},
|
||||
{
|
||||
"Name": "Luzerne",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 1.779,
|
||||
"HarvestIndex": 0.5
|
||||
},
|
||||
{
|
||||
"Name": "Other_crops",
|
||||
"DM_content": 0.7,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.0359063662409858,
|
||||
"HarvestIndex": 0.5
|
||||
},
|
||||
{
|
||||
"Name": "Other_seeds",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.7155172413793105,
|
||||
"HarvestIndex": 0.5
|
||||
},
|
||||
{
|
||||
"Name": "Triticale",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.5,
|
||||
"C_input_CropRes": 2.2790322580645164,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Rapeseed",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.5,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Strawberry",
|
||||
"DM_content": 0.15,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.0,
|
||||
"HarvestIndex": 0.5
|
||||
},
|
||||
{
|
||||
"Name": "Rye",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.5,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Other_fruits",
|
||||
"DM_content": 0.15,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.6,
|
||||
"HarvestIndex": 1.0
|
||||
},
|
||||
{
|
||||
"Name": "oats",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.5,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Green_manure",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 3.7,
|
||||
"HarvestIndex": 0.3
|
||||
},
|
||||
{
|
||||
"Name": "Fibres",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.13636363636363635,
|
||||
"HarvestIndex": 0.92
|
||||
},
|
||||
{
|
||||
"Name": "Sunflower",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 0.0,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Fodder_beet",
|
||||
"DM_content": 0.25,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.732142857142857,
|
||||
"HarvestIndex": 0.69
|
||||
},
|
||||
{
|
||||
"Name": "Other_cereals",
|
||||
"DM_content": 0.85,
|
||||
"FracR": 0.5,
|
||||
"C_input_CropRes": 2.0359063662409853,
|
||||
"HarvestIndex": 0.46
|
||||
},
|
||||
{
|
||||
"Name": "Wine",
|
||||
"DM_content": 0.15,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.6,
|
||||
"HarvestIndex": 0.7
|
||||
},
|
||||
{
|
||||
"Name": "Miscanthus",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 5.1,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Switchgrass",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 5.1,
|
||||
"HarvestIndex": 0.444
|
||||
},
|
||||
{
|
||||
"Name": "Willow",
|
||||
"DM_content": 1.0,
|
||||
"FracR": 0.0,
|
||||
"C_input_CropRes": 2.6,
|
||||
"HarvestIndex": 0.85
|
||||
}
|
||||
]
|
||||
78
CarbonConsoleApp/config25/CropSets.json
Normal file
78
CarbonConsoleApp/config25/CropSets.json
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"StrawCrops": [
|
||||
{
|
||||
"StrawCrop": "Maize",
|
||||
"DM_Content": 0.7
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Corn_cob_mix",
|
||||
"DM_Content": 0.7
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Winter_wheat",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Summer_wheat",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Summer_barley",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "winter_barley",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Rapeseed",
|
||||
"DM_Content": 0.6
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Rye",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "oats",
|
||||
"DM_Content": 0.85
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Sunflower",
|
||||
"DM_Content": 0.6
|
||||
},
|
||||
{
|
||||
"StrawCrop": "Other_cereals",
|
||||
"DM_Content": 0.85
|
||||
}
|
||||
],
|
||||
"GreenManureType": [
|
||||
"Bladrammenas",
|
||||
"GeleMosterd",
|
||||
"Voederwikke",
|
||||
"Afrikaantjes",
|
||||
"JapanseHaver",
|
||||
"ItaliaansRaaigras",
|
||||
"Mengsel3soorten",
|
||||
"Mengsel12soorten",
|
||||
"EngelsRaaigras",
|
||||
"Facelia",
|
||||
"Grasland",
|
||||
"Overig",
|
||||
"Rietzwenkgras"
|
||||
],
|
||||
"Perennial": [
|
||||
"Nurseries",
|
||||
"Apples",
|
||||
"Pears",
|
||||
"Other_fruits",
|
||||
"Wine",
|
||||
"Miscanthus",
|
||||
"Switchgrass",
|
||||
"Willow"
|
||||
],
|
||||
"Grass_nat": [
|
||||
"Perm_gras",
|
||||
"Nat_gras",
|
||||
"Gras"
|
||||
]
|
||||
}
|
||||
1
CarbonConsoleApp/config25/CropYield.json
Normal file
1
CarbonConsoleApp/config25/CropYield.json
Normal file
File diff suppressed because one or more lines are too long
76
CarbonConsoleApp/config25/Farm_input_sets.json
Normal file
76
CarbonConsoleApp/config25/Farm_input_sets.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"ManureSources_liv": [
|
||||
{
|
||||
"ManureSource_liv": "WMGRAAS",
|
||||
"Description": "Weidemest graasdieren"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "DMGRAAS",
|
||||
"Description": "Drijfmest graasdieren"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "VMGRAAS",
|
||||
"Description": "Vaste mest graasdieren"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "DMSTAL",
|
||||
"Description": "Drijfmest staldieren"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "VMSTAL",
|
||||
"Description": "Vaste mest staldieren"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "FRACDUN",
|
||||
"Description": "Dunne Fractie"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "FRACDIK",
|
||||
"Description": "Dikke Fractie"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "KMVERV",
|
||||
"Description": "Kunstmestvervangers"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "DIGEST",
|
||||
"Description": "Digestaat"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "CHAMPOST",
|
||||
"Description": "Champost"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "SCHA_GEIT",
|
||||
"Description": "Schapen/geitenmest"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "VMPIG",
|
||||
"Description": "Vaste varkensmest"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "DM_ZEUG",
|
||||
"Description": "Zeugendrijfmest"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "BOKASHI",
|
||||
"Description": "Bokashi"
|
||||
},
|
||||
{
|
||||
"ManureSource_liv": "OVERIG",
|
||||
"Description": "Overig"
|
||||
}
|
||||
],
|
||||
"composts": [
|
||||
{
|
||||
"compost": "COMPOST",
|
||||
"Description": "compost"
|
||||
}
|
||||
],
|
||||
"CarbonSource": [
|
||||
"CarbonManure",
|
||||
"CarbonResidues",
|
||||
"CarbonGreenManure",
|
||||
"CarbonCompost"
|
||||
]
|
||||
}
|
||||
4529
CarbonConsoleApp/config25/FarmmapsRvoMiterraCrops.json
Normal file
4529
CarbonConsoleApp/config25/FarmmapsRvoMiterraCrops.json
Normal file
File diff suppressed because it is too large
Load Diff
7
CarbonConsoleApp/config25/GIS_Soil_Sets.json
Normal file
7
CarbonConsoleApp/config25/GIS_Soil_Sets.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"SoilType": [ "Moerig", "Veen", "Klei", "Zand", "Loss" ],
|
||||
"MineralSoils": [ "Klei", "Zand" ],
|
||||
"Months": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12", "Total", "Average" ],
|
||||
"AllMonths": [ "M1", "M2", "M3", "M4", "M5", "M6", "M7", "M8", "M9", "M10", "M11", "M12" ],
|
||||
"ClimateVar": [ "Evapotranspiration", "Precipitation", "Temperature" ]
|
||||
}
|
||||
6721
CarbonConsoleApp/config25/KNMI_data.csv
Normal file
6721
CarbonConsoleApp/config25/KNMI_data.csv
Normal file
File diff suppressed because it is too large
Load Diff
1681
CarbonConsoleApp/config25/KNMI_data.csv.bak
Normal file
1681
CarbonConsoleApp/config25/KNMI_data.csv.bak
Normal file
File diff suppressed because it is too large
Load Diff
66
CarbonConsoleApp/config25/ManCcont.json
Normal file
66
CarbonConsoleApp/config25/ManCcont.json
Normal file
@@ -0,0 +1,66 @@
|
||||
[
|
||||
{
|
||||
"ManCcont": "WMGRAAS",
|
||||
"Value": 0.0356
|
||||
},
|
||||
{
|
||||
"ManCcont": "DMGRAAS",
|
||||
"Value": 0.0356
|
||||
},
|
||||
{
|
||||
"ManCcont": "VMGRAAS",
|
||||
"Value": 0.077385
|
||||
},
|
||||
{
|
||||
"ManCcont": "DMSTAL",
|
||||
"Value": 0.03955
|
||||
},
|
||||
{
|
||||
"ManCcont": "VMSTAL",
|
||||
"Value": 0.209715
|
||||
},
|
||||
{
|
||||
"ManCcont": "COMPOST",
|
||||
"Value": 0.10535
|
||||
},
|
||||
{
|
||||
"ManCcont": "FRACDUN",
|
||||
"Value": 0.01715
|
||||
},
|
||||
{
|
||||
"ManCcont": "FRACDIK",
|
||||
"Value": 0.0759
|
||||
},
|
||||
{
|
||||
"ManCcont": "KMVERV",
|
||||
"Value": 0.010585
|
||||
},
|
||||
{
|
||||
"ManCcont": "DIGEST",
|
||||
"Value": 0.01652
|
||||
},
|
||||
{
|
||||
"ManCcont": "CHAMPOST",
|
||||
"Value": 0.1050
|
||||
},
|
||||
{
|
||||
"ManCcont": "SCHA_GEIT",
|
||||
"Value": 0.09225
|
||||
},
|
||||
{
|
||||
"ManCcont": "VMPIG",
|
||||
"Value": 0.0765
|
||||
},
|
||||
{
|
||||
"ManCcont": "DM_ZEUG",
|
||||
"Value": 0.0125
|
||||
},
|
||||
{
|
||||
"ManCcont": "BOKASHI",
|
||||
"Value": 0.19
|
||||
},
|
||||
{
|
||||
"ManCcont": "OVERIG",
|
||||
"Value": 0.01652
|
||||
}
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,303 @@
|
||||
[
|
||||
{
|
||||
"CropCode": "1020101",
|
||||
"CropName": "Wintertarwe",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1020102",
|
||||
"CropName": "Wintergerst",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1020103",
|
||||
"CropName": "Winterrogge",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1020201",
|
||||
"CropName": "Zomertarwe",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1020202",
|
||||
"CropName": "Zomergerst",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1020203",
|
||||
"CropName": "Zomerrogge",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": ""
|
||||
},
|
||||
{
|
||||
"CropCode": "1030301",
|
||||
"CropName": "Alexandrijnse klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030302",
|
||||
"CropName": "Bastaard klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030303",
|
||||
"CropName": "Hopklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030304",
|
||||
"CropName": "Inkarnaatklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030305",
|
||||
"CropName": "Perzische klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030306",
|
||||
"CropName": "Rode klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030307",
|
||||
"CropName": "Rolklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030308",
|
||||
"CropName": "Witte honingklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030309",
|
||||
"CropName": "Witte klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030401",
|
||||
"CropName": "Blauwe Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030402",
|
||||
"CropName": "Gele Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030403",
|
||||
"CropName": "Witte Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030501",
|
||||
"CropName": "Voederwikke",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030502",
|
||||
"CropName": "Bonte wikke",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Voederwikke"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030602",
|
||||
"CropName": "Hanekam",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040101",
|
||||
"CropName": "Stoppelknol",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040102",
|
||||
"CropName": "Bladrammenas",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Bladrammenas"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040103",
|
||||
"CropName": "Bruine mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "GeleMosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040104",
|
||||
"CropName": "Gele mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "GeleMosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040105",
|
||||
"CropName": "Zwarte mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "GeleMosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040108",
|
||||
"CropName": "Bladkool",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040109",
|
||||
"CropName": "Mergkool",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040110",
|
||||
"CropName": "Ethiopische mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "GeleMosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040111",
|
||||
"CropName": "Serepta mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "GeleMosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040112",
|
||||
"CropName": "Zwaardherik",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050101",
|
||||
"CropName": "Engels raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "EngelsRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050102",
|
||||
"CropName": "Frans raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "ItaliaansRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050103",
|
||||
"CropName": "Gekruist raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "ItaliaansRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050104",
|
||||
"CropName": "Italiaans raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "ItaliaansRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050105",
|
||||
"CropName": "Trosraaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "ItaliaansRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050106",
|
||||
"CropName": "Westerwolds raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "ItaliaansRaaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050201",
|
||||
"CropName": "Roodzwenkgras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Rietzwenkgras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050408",
|
||||
"CropName": "Sudangras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Rietzwenkgras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080107",
|
||||
"CropName": "Facelia",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Facelia"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080108",
|
||||
"CropName": "Spurrie",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080109",
|
||||
"CropName": "Afrikaantjes",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Afrikaantjes"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080110",
|
||||
"CropName": "Raketblad",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Overig"
|
||||
}
|
||||
]
|
||||
1
CarbonConsoleApp/config25/PC4/PC4.cpg
Normal file
1
CarbonConsoleApp/config25/PC4/PC4.cpg
Normal file
@@ -0,0 +1 @@
|
||||
UTF-8
|
||||
BIN
CarbonConsoleApp/config25/PC4/PC4.dbf
Normal file
BIN
CarbonConsoleApp/config25/PC4/PC4.dbf
Normal file
Binary file not shown.
1
CarbonConsoleApp/config25/PC4/PC4.prj
Normal file
1
CarbonConsoleApp/config25/PC4/PC4.prj
Normal file
@@ -0,0 +1 @@
|
||||
PROJCS["RD_New",GEOGCS["GCS_Amersfoort",DATUM["D_Amersfoort",SPHEROID["Bessel_1841",6377397.155,299.1528128]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Double_Stereographic"],PARAMETER["False_Easting",155000.0],PARAMETER["False_Northing",463000.0],PARAMETER["Central_Meridian",5.38763888888889],PARAMETER["Scale_Factor",0.9999079],PARAMETER["Latitude_Of_Origin",52.15616055555555],UNIT["Meter",1.0]]
|
||||
BIN
CarbonConsoleApp/config25/PC4/PC4.shp
Normal file
BIN
CarbonConsoleApp/config25/PC4/PC4.shp
Normal file
Binary file not shown.
BIN
CarbonConsoleApp/config25/PC4/PC4.shx
Normal file
BIN
CarbonConsoleApp/config25/PC4/PC4.shx
Normal file
Binary file not shown.
10
CarbonConsoleApp/config25/ParametersRothC.json
Normal file
10
CarbonConsoleApp/config25/ParametersRothC.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"LayerDepth": 25.0,
|
||||
"kDPM": 10.0,
|
||||
"kRPM": 0.3,
|
||||
"kBIO": 0.66,
|
||||
"kHUM": 0.02,
|
||||
"StubbleFraction": 0.45,
|
||||
"CarbonBiomass": 0.45,
|
||||
"FracBelowGroundCinput": 0.25
|
||||
}
|
||||
4035
CarbonConsoleApp/config25/RegionSets.json
Normal file
4035
CarbonConsoleApp/config25/RegionSets.json
Normal file
File diff suppressed because it is too large
Load Diff
1
CarbonConsoleApp/config25/RvoCrops.json
Normal file
1
CarbonConsoleApp/config25/RvoCrops.json
Normal file
File diff suppressed because one or more lines are too long
8155
CarbonConsoleApp/config25/SetsForDataTransformation.json
Normal file
8155
CarbonConsoleApp/config25/SetsForDataTransformation.json
Normal file
File diff suppressed because it is too large
Load Diff
123
CarbonConsoleApp/config25/YieldGreenManure.json
Normal file
123
CarbonConsoleApp/config25/YieldGreenManure.json
Normal file
@@ -0,0 +1,123 @@
|
||||
[
|
||||
{
|
||||
"ManureName": "Bladrammenas",
|
||||
"GoodQuality": 3.573099415204678,
|
||||
"AverageQuality": 2.5011695906432747,
|
||||
"BadQuality": 1.786549707602339
|
||||
},
|
||||
{
|
||||
"ManureName": "GeleMosterd",
|
||||
"GoodQuality": 2.05696405648267,
|
||||
"AverageQuality": 1.4398748395378689,
|
||||
"BadQuality": 1.028482028241335
|
||||
},
|
||||
{
|
||||
"ManureName": "Voederwikke",
|
||||
"GoodQuality": 1.2933673469387754,
|
||||
"AverageQuality": 0.9053571428571427,
|
||||
"BadQuality": 0.6466836734693877
|
||||
},
|
||||
{
|
||||
"ManureName": "Afrikaantjes",
|
||||
"GoodQuality": 2.8392857142857153,
|
||||
"AverageQuality": 1.9875000000000005,
|
||||
"BadQuality": 1.4196428571428577
|
||||
},
|
||||
{
|
||||
"ManureName": "JapanseHaver",
|
||||
"GoodQuality": 2.5844583333333335,
|
||||
"AverageQuality": 1.8091208333333333,
|
||||
"BadQuality": 1.2922291666666668
|
||||
},
|
||||
{
|
||||
"ManureName": "ItaliaansRaaigras",
|
||||
"GoodQuality": 3.1635153508771934,
|
||||
"AverageQuality": 2.2144607456140353,
|
||||
"BadQuality": 1.5817576754385967
|
||||
},
|
||||
{
|
||||
"ManureName": "Rogge",
|
||||
"GoodQuality": 2.5,
|
||||
"AverageQuality": 1.75,
|
||||
"BadQuality": 1.25
|
||||
},
|
||||
{
|
||||
"ManureName": "Graan",
|
||||
"GoodQuality": 2.2,
|
||||
"AverageQuality": 1.54,
|
||||
"BadQuality": 1.1
|
||||
},
|
||||
{
|
||||
"ManureName": "Haver",
|
||||
"GoodQuality": 2.6,
|
||||
"AverageQuality": 1.82,
|
||||
"BadQuality": 1.3
|
||||
},
|
||||
{
|
||||
"ManureName": "Gerst",
|
||||
"GoodQuality": 2.55,
|
||||
"AverageQuality": 1.785,
|
||||
"BadQuality": 1.275
|
||||
},
|
||||
{
|
||||
"ManureName": "Mengsel_groenbraak",
|
||||
"GoodQuality": 2.8,
|
||||
"AverageQuality": 1.96,
|
||||
"BadQuality": 1.4
|
||||
},
|
||||
{
|
||||
"ManureName": "Mengsel_natuurbraak",
|
||||
"GoodQuality": 3.0,
|
||||
"AverageQuality": 2.1,
|
||||
"BadQuality": 1.5
|
||||
},
|
||||
{
|
||||
"ManureName": "Mengsel_Nbron",
|
||||
"GoodQuality": 2.8,
|
||||
"AverageQuality": 1.96,
|
||||
"BadQuality": 1.4
|
||||
},
|
||||
{
|
||||
"ManureName": "Mengsel_Nvang",
|
||||
"GoodQuality": 2.8,
|
||||
"AverageQuality": 1.96,
|
||||
"BadQuality": 1.4
|
||||
},
|
||||
{
|
||||
"ManureName": "EngelsRaaigras",
|
||||
"GoodQuality": 3.1635153508771934,
|
||||
"AverageQuality": 2.2144607456140353,
|
||||
"BadQuality": 1.5817576754385967
|
||||
},
|
||||
{
|
||||
"ManureName": "Facelia",
|
||||
"GoodQuality": 0.2925,
|
||||
"AverageQuality": 0.20475,
|
||||
"BadQuality": 0.14625
|
||||
},
|
||||
{
|
||||
"ManureName": "Grasland",
|
||||
"GoodQuality": 3.418421052631579,
|
||||
"AverageQuality": 2.3928947368421056,
|
||||
"BadQuality": 1.7092105263157895
|
||||
},
|
||||
{
|
||||
"ManureName": "Overig",
|
||||
"GoodQuality": 6.728475765306122,
|
||||
"AverageQuality": 4.709933035714285,
|
||||
"BadQuality": 3.364237882653061
|
||||
},
|
||||
{
|
||||
"ManureName": "Rietzwenkgras",
|
||||
"GoodQuality": 3.1635153508771934,
|
||||
"AverageQuality": 2.2144607456140353,
|
||||
"BadQuality": 1.5817576754385967
|
||||
},
|
||||
{
|
||||
"ManureName": "Triticale",
|
||||
"GoodQuality": 2.2,
|
||||
"AverageQuality": 1.54,
|
||||
"BadQuality": 1.1
|
||||
}
|
||||
|
||||
]
|
||||
40321
CarbonConsoleApp/config25/klimaatscenario.csv
Normal file
40321
CarbonConsoleApp/config25/klimaatscenario.csv
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,83 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<AssemblyName>CarbonLib</AssemblyName>
|
||||
<PackageId>CarbonLib</PackageId>
|
||||
<RuntimeIdentifiers>win10-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
||||
<Version>1.2.0</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Base.Core.Common" Version="1.2.2.10" />
|
||||
<PackageReference Include="Base.Core.Common.Geometry" Version="1.4.0" />
|
||||
<PackageReference Include="NetTopologySuite" Version="2.0.0" />
|
||||
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="2.0.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="config\CropCoverMonth.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\CropProperties.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\CropSets.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\CropYield.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\CropYield.json.old">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\Farm_input_sets.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\GIS_Soil_Sets.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\KNMI_data.csv">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\ManCcont.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\Mapping\MappingCropsFarmmapsMiterraRothC.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\Mapping\MappingGreenManureFarmmapsMiterraRothC.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\ParametersRothC.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\PC4\PC4.cpg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\PC4\PC4.dbf">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\PC4\PC4.prj">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\PC4\PC4.shp">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\PC4\PC4.shx">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\RegionSets.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\SetsForDataTransformation.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="config\YieldGreenManure.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,9 +1,11 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30907.101
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.36414.22 d17.14
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarbonLib", "CarbonLib.csproj", "{51876378-DB3E-4D30-8EDA-83DDDCE4C4ED}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarbonLib", "CarbonLib\CarbonLib.csproj", "{51876378-DB3E-4D30-8EDA-83DDDCE4C4ED}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CarbonConsoleApp", "CarbonConsoleApp\CarbonConsoleApp.csproj", "{A961AA67-3D88-E648-51CC-5DAC78203614}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -15,6 +17,10 @@ Global
|
||||
{51876378-DB3E-4D30-8EDA-83DDDCE4C4ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{51876378-DB3E-4D30-8EDA-83DDDCE4C4ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{51876378-DB3E-4D30-8EDA-83DDDCE4C4ED}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A961AA67-3D88-E648-51CC-5DAC78203614}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A961AA67-3D88-E648-51CC-5DAC78203614}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A961AA67-3D88-E648-51CC-5DAC78203614}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A961AA67-3D88-E648-51CC-5DAC78203614}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
20
CarbonLib/CarbonCalculation.cs
Normal file
20
CarbonLib/CarbonCalculation.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using CarbonLib.Carbon;
|
||||
using CarbonService.Models;
|
||||
using CarbonLib.Carbon.Models;
|
||||
using System;
|
||||
|
||||
namespace CarbonLib
|
||||
{
|
||||
public abstract class CarbonCalculation : ICarbonCalculation
|
||||
{
|
||||
public abstract CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput);
|
||||
public abstract string Validate(CarbonRequest farmInput);
|
||||
public abstract CarbonSummary Calculate(CarbonRequest farmInput);
|
||||
public abstract CarbonSummary CalculateClimateScenario(CarbonRequest farmInput);
|
||||
|
||||
public double? GetCropYield(string cropCode, int year, int postalCode)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
using Base.Core.Common;
|
||||
using Base.Core.Common.Geometry;
|
||||
using CarbonService.Models;
|
||||
using FarmMapsAPI.Carbon.Models;
|
||||
using NetTopologySuite.Geometries;
|
||||
using OSGeo.OGR;
|
||||
using CarbonService.Models;
|
||||
using CarbonLib.Carbon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon
|
||||
namespace CarbonLib.Carbon
|
||||
{
|
||||
public class CarbonCalculation
|
||||
public class CarbonCalculation24 : ICarbonCalculation
|
||||
{
|
||||
private readonly string configPath;
|
||||
|
||||
@@ -32,7 +27,7 @@ namespace FarmMapsAPI.Carbon
|
||||
private List<MappingCropFarmmapsMiterraRothC> mappingCropFarmmapsMiterraRothC;
|
||||
private List<MappingGreenManureFarmmapsMiterraRothC> mappingGreenManureFarmmapsMiterraRothC;
|
||||
|
||||
public CarbonCalculation(string configPath)
|
||||
public CarbonCalculation24(string configPath)
|
||||
{
|
||||
this.configPath = configPath;
|
||||
|
||||
@@ -102,19 +97,19 @@ namespace FarmMapsAPI.Carbon
|
||||
}
|
||||
}
|
||||
|
||||
var allGreenManure = farmInput.CropFields.SelectMany(s => s.GreenManures.SelectMany(x=>x.GreenManureTypes)).Distinct();
|
||||
var allGreenManure = farmInput.CropFields.SelectMany(s => s.GreenManures.SelectMany(x => x.GreenManureTypes)).Distinct();
|
||||
foreach (var greenManure in allGreenManure)
|
||||
{
|
||||
if (!yieldGreenManureConfig.Any(x=>x.ManureName.ToLower() == greenManure.Type.ToLower()))
|
||||
if (!yieldGreenManureConfig.Any(x => x.ManureName.ToLower() == greenManure.Type.ToLower()))
|
||||
{
|
||||
return $"Unknown green manure {greenManure.Type}";
|
||||
}
|
||||
}
|
||||
|
||||
var allOrgManure = farmInput.CropFields.SelectMany(x => x.HistoricalCropData.SelectMany(s => s.Crops.Where(w=>w.OrganicManures != null).SelectMany(y=>y.OrganicManures.Select(r=>r.Type)))).Distinct();
|
||||
var allOrgManure = farmInput.CropFields.SelectMany(x => x.HistoricalCropData.SelectMany(s => s.Crops.Where(w => w.OrganicManures != null).SelectMany(y => y.OrganicManures.Select(r => r.Type)))).Distinct();
|
||||
foreach (var orgManure in allOrgManure)
|
||||
{
|
||||
if (!manCcontConfig.Any(x=>x.ManCcont == orgManure))
|
||||
if (!manCcontConfig.Any(x => x.ManCcont == orgManure))
|
||||
{
|
||||
return $"Unknown organic manure {orgManure}";
|
||||
}
|
||||
@@ -139,9 +134,9 @@ namespace FarmMapsAPI.Carbon
|
||||
Area = cropField.Area,
|
||||
HistoricalCropData = mappedCropData,
|
||||
SoilType = MapSoil(cropField.SoilType),
|
||||
SoilProperty = new SoilProperty { Clay_Content = cropField.SoilProperty.Clay_Content, OM_Const = cropField.SoilProperty.OM_Const, Depth10 = cropField.SoilProperty.Depth10 },
|
||||
SoilProperty = new SoilProperty { Clay_Content = cropField.SoilProperty.Clay_Content, OM_Const = cropField.SoilProperty.OM_Const, C_Const = cropField.SoilProperty.C_Const, Depth10 = cropField.SoilProperty.Depth10, Depth = cropField.SoilProperty.Depth, OM_Choice = cropField.SoilProperty.OM_Choice },
|
||||
GreenManures = greenManures
|
||||
});
|
||||
});
|
||||
foreach (var crops in cropField.HistoricalCropData)
|
||||
{
|
||||
foreach (var cropYear in crops.Crops)
|
||||
@@ -156,8 +151,9 @@ namespace FarmMapsAPI.Carbon
|
||||
Crop = cropYear.MiterraCropName,
|
||||
CropRes = cropYear.CropRes,
|
||||
OrganicManures =
|
||||
cropYear.OrganicManures.Where(y=>y.Quantity > 0 && !string.IsNullOrEmpty(y.Type)).Select(x => new OrganicManureType { Type = x.Type, Quantity = x.Quantity }).ToList(),
|
||||
CropYield = cropYear.CropYield } }
|
||||
cropYear.OrganicManures.Where(y=>y.Quantity > 0 && !string.IsNullOrEmpty(y.Type)).Select(x => new OrganicManureType { Type = x.Type, Quantity = x.Quantity.HasValue? x.Quantity.Value : 0 }).ToList(),
|
||||
CropYield = cropYear.CropYield,
|
||||
Irrigation = crops.Irrigations} }
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -170,9 +166,9 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
foreach (var manure in cropYear.OrganicManures)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(manure.Type) && manure.Quantity > 0)
|
||||
if (!string.IsNullOrEmpty(manure.Type) && manure.Quantity.HasValue && manure.Quantity > 0)
|
||||
{
|
||||
orgManure.Add(new OrganicManureType { Type = manure.Type, Quantity = manure.Quantity });
|
||||
orgManure.Add(new OrganicManureType { Type = manure.Type, Quantity = manure.Quantity.HasValue ? manure.Quantity.Value : 0 });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,7 +201,7 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
greenManures.Add(new GreenManure { Year = crops.Year, GreenManureTypes = new List<GreenManureType> { new GreenManureType { Type = greenManure, Quality = cropYear.Quality == QualityFarmMaps.Good ? Quality.Good : cropYear.Quality == QualityFarmMaps.Bad ? Quality.Bad : Quality.Average } } });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return mappedInput;
|
||||
@@ -215,14 +211,47 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
string provinceCode = GetProvinceCode(dataTransformationSet, postalCode);
|
||||
var crpYield = cropYieldConfig.SingleOrDefault(x => x.CropName.ToLower() == cropCode.ToLower());
|
||||
if (crpYield == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var crpYieldProvince = crpYield.Yields.SingleOrDefault(x => x.ProvinceCode == provinceCode);
|
||||
if (crpYieldProvince == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
var cropYield = crpYieldProvince.YearData.SingleOrDefault(x => x.Year == year)?.YieldValue;
|
||||
return cropYield;
|
||||
}
|
||||
|
||||
public CarbonSummary CalculateClimateScenario(CarbonRequest farmInput)
|
||||
{
|
||||
var simpleResult = Calculate(farmInput);
|
||||
return simpleResult;
|
||||
}
|
||||
|
||||
private List<double> GetMinMaxMedian(List<YearSummary> yearData, int year, string varName)
|
||||
{
|
||||
|
||||
if (yearData.Count == 0)
|
||||
{
|
||||
|
||||
}
|
||||
var minValue = (double)yearData.Min(s => s.GetType().GetProperty(varName).GetValue(s));
|
||||
var medianValue = CalculateMedian(yearData.Select(s => Convert.ToDouble(s.GetType().GetProperty(varName).GetValue(s))).ToList());
|
||||
var maxValue = (double)yearData.Max(s => s.GetType().GetProperty(varName).GetValue(s));
|
||||
return new List<double> { minValue, medianValue, maxValue };
|
||||
}
|
||||
|
||||
public CarbonSummary Calculate(CarbonRequest farmInput)
|
||||
{
|
||||
return Calculate(farmInput, 0);
|
||||
}
|
||||
|
||||
public CarbonSummary Calculate(CarbonRequest farmInput, int climateScenarioNumber = 0, Dictionary<(string, string, int), ClimateVariable> climate = null)
|
||||
{
|
||||
var knmiFile = Helper.GetPlatformIndependentDirectoryPath(Path.Combine(configPath, "KNMI_data.csv"));
|
||||
var climateFile = Helper.GetPlatformIndependentDirectoryPath(Path.Combine(configPath, "klimaatscenario.csv"));
|
||||
|
||||
// soilTypeData (external input)
|
||||
var soilTypeData = GetSoilTypeData(farmInput);
|
||||
@@ -238,6 +267,7 @@ namespace FarmMapsAPI.Carbon
|
||||
|
||||
var year = GetYears(farmInputSet, farmInput);
|
||||
|
||||
|
||||
//////////////////////////////////////////////
|
||||
// precalculations
|
||||
//////////////////////////////////////////////
|
||||
@@ -246,43 +276,64 @@ namespace FarmMapsAPI.Carbon
|
||||
//soilPropSoilType
|
||||
var soilPropSoilType = GetSoilPropSoilType(soilTypeData, soilPropertiesField);
|
||||
|
||||
//soilPropertiesField (again) --> remove this
|
||||
//if OM_cont > 0, then C_cont = OM_cont *0.54, else take C_cont from input
|
||||
foreach (var item in soilPropertiesField)
|
||||
{
|
||||
var soilProps = soilPropSoilType.Keys.Where(x => x.Item1 == item.Key).ToList();
|
||||
var sumCorr = 0.0;
|
||||
double? sumC_Cont = null;
|
||||
foreach (var soilProp in soilProps)
|
||||
{
|
||||
sumCorr += soilPropSoilType[soilProp].OM_Corr;
|
||||
if (soilPropSoilType[soilProp].OM_Cont > 0)
|
||||
{
|
||||
if (sumC_Cont == null)
|
||||
{
|
||||
sumC_Cont = soilPropSoilType[soilProp].OM_Cont * 0.54;
|
||||
}
|
||||
else
|
||||
{
|
||||
sumC_Cont += soilPropSoilType[soilProp].OM_Cont * 0.54;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (sumC_Cont.HasValue)
|
||||
{
|
||||
item.Value.C_Cont = sumC_Cont.Value;
|
||||
}
|
||||
item.Value.OM_Corr = sumCorr;
|
||||
}
|
||||
|
||||
var oM_corr_SoilType = new Dictionary<(string,string), double>();
|
||||
var oM_corr_SoilType = new Dictionary<(string, string), double>();
|
||||
var c_corr_SoilType = new Dictionary<(string, string), double>();
|
||||
foreach (var item in soilPropertiesField)
|
||||
{
|
||||
var soilOfItem = soilTypeData[item.Key].FirstOrDefault();
|
||||
var initialSoilKey = historicalCropdata.Keys.FirstOrDefault(x => x.Item1 == item.Key && x.Item2 == year.First());
|
||||
var initialSoil = historicalCropdata[initialSoilKey].FirstOrDefault();
|
||||
var soilPropertyDepth10 = item.Value.Depth10;
|
||||
if (item.Value.Depth.HasValue && item.Value.Depth.Value == 10)
|
||||
{
|
||||
soilPropertyDepth10 = true;
|
||||
}
|
||||
// Different corrections for depth (10, 25, 30 cm)
|
||||
// depth of 10cm has same result as previous checkbox (sample taken at 10cm)
|
||||
parameterSet.LayerDepth = item.Value.Depth.HasValue ? item.Value.Depth.Value : parameterSet.LayerDepth;
|
||||
if (initialSoil == "Temp_gras" && soilPropertyDepth10)
|
||||
{
|
||||
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont * 0.97);
|
||||
}
|
||||
c_corr_SoilType.Add((item.Key, soilOfItem), item.Value.C_Cont * 0.97);
|
||||
}
|
||||
else if (cropSet.Grass_nat.Contains(initialSoil) && soilPropertyDepth10 && (soilOfItem == "Klei" || soilOfItem == "Zand"))
|
||||
{
|
||||
if (soilOfItem == "Klei")
|
||||
{
|
||||
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont * 0.67);
|
||||
c_corr_SoilType.Add((item.Key, soilOfItem), item.Value.C_Cont * 0.67);
|
||||
}
|
||||
else
|
||||
{
|
||||
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont * 0.81);
|
||||
c_corr_SoilType.Add((item.Key, soilOfItem), item.Value.C_Cont * 0.81);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oM_corr_SoilType.Add((item.Key, soilOfItem), item.Value.OM_Cont);
|
||||
c_corr_SoilType.Add((item.Key, soilOfItem), item.Value.C_Cont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,6 +342,12 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
oM_Corr.Add(item.Key.Item1, item.Value);
|
||||
}
|
||||
var c_Corr = new Dictionary<string, double>();
|
||||
foreach (var item in c_corr_SoilType)
|
||||
{
|
||||
c_Corr.Add(item.Key.Item1, item.Value);
|
||||
oM_corr_SoilType.Add(item.Key, item.Value * (1 / 0.54));
|
||||
}
|
||||
|
||||
// soilBulkDensities
|
||||
Dictionary<string, SoilBulkDensityType> soilBulkDensities = GetSoilBulkDensities(soilPropertiesField, soilTypeData, soilPropSoilType, oM_corr_SoilType);
|
||||
@@ -332,7 +389,7 @@ namespace FarmMapsAPI.Carbon
|
||||
// loop rothc
|
||||
//////////////////////////////////////////
|
||||
|
||||
var soc_Field = new Dictionary<string, List<YearColumnValue>>();
|
||||
var soc_Field = new Dictionary<string, List<YearColumnValue>>();
|
||||
|
||||
var cropAreaField1 = new Dictionary<(string, int), List<ColumnValue>>();
|
||||
var carbonInputs = new GamsThreeKeyParameter();
|
||||
@@ -367,7 +424,15 @@ namespace FarmMapsAPI.Carbon
|
||||
}
|
||||
cropAreaFarm.Add(("Farmname", loopYear), croplist);
|
||||
|
||||
Dictionary<string, List<ClimateVariable>> climateVariable = GetClimateVariable(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput);
|
||||
Dictionary<string, List<ClimateVariable>> climateVariable;
|
||||
if (climateScenarioNumber == 0)
|
||||
{
|
||||
climateVariable = GetClimateVariable(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput, climateFile, climateScenarioNumber);
|
||||
}
|
||||
else
|
||||
{
|
||||
climateVariable = GetClimateVariable2(knmiFile, dataTransformationSet, gisSoilSet, loopYear, farmInput, climateFile, climateScenarioNumber, climate);
|
||||
}
|
||||
|
||||
// Crop and soil areas
|
||||
// soilArea keys: (fieldname, year, soil)
|
||||
@@ -449,7 +514,7 @@ namespace FarmMapsAPI.Carbon
|
||||
carbonInputManure2[(field.Name, cropData.Crop)].Add(new ColumnValue(compost.Type, result));
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
carbonInputManure2.Add((field.Name, cropData.Crop), new List<ColumnValue> { new ColumnValue(compost.Type, result) });
|
||||
}
|
||||
}
|
||||
@@ -539,7 +604,7 @@ namespace FarmMapsAPI.Carbon
|
||||
newValue = 0.024 * item.Value + 0.228;
|
||||
valueList.Add(new ColumnValue(item.Key, newValue));
|
||||
break;
|
||||
case "Corn_Cob_mix":
|
||||
case "Corn_cob_mix":
|
||||
newValue = 0.024 * item.Value + 0.228;
|
||||
valueList.Add(new ColumnValue(item.Key, newValue));
|
||||
break;
|
||||
@@ -640,11 +705,7 @@ namespace FarmMapsAPI.Carbon
|
||||
foreach (var crop in cropArea.Value)
|
||||
{
|
||||
var cInputCropRes = cropPropertyConfig.SingleOrDefault(s => s.Name.ToLower() == crop.Key.ToLower())?.C_input_CropRes ?? 0.0;
|
||||
if (cInputCropRes > 0)
|
||||
{
|
||||
carbonInputs.AddValue((cropArea.Key.Item1, cropArea.Key.Item2, crop.Key), "CarbonResidues", cInputCropRes);
|
||||
|
||||
}
|
||||
carbonInputs.AddValue((cropArea.Key.Item1, cropArea.Key.Item2, crop.Key), "CarbonResidues", cInputCropRes);
|
||||
|
||||
if (cropSet.StrawCrops.Any(x => x.StrawCrop.ToLower() == crop.Key.ToLower()))
|
||||
{
|
||||
@@ -724,7 +785,7 @@ namespace FarmMapsAPI.Carbon
|
||||
}
|
||||
tempModFactor.Add(climateVar.Key, valueList);
|
||||
}
|
||||
|
||||
|
||||
// CoverModFactor
|
||||
// input sheet
|
||||
var coverModFactor = new Dictionary<string, List<ColumnValue>>();
|
||||
@@ -765,7 +826,7 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
|
||||
|
||||
/* smdMax met factor maand corrigeren
|
||||
SMDmax(Field,Crop,AllMonths) = ifthen(CropCoverMonths(Crop,AllMonths)=1,
|
||||
SMDmax(Field,Crop,AllMonths),SMDmax(Field,Crop,AllMonths)/1.8);
|
||||
@@ -778,8 +839,18 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
smdMaxValue = smdMax[climateItem.Key] / 1.8;
|
||||
}
|
||||
|
||||
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration;
|
||||
//fsa todo: add precipitation
|
||||
var irrigation = 0;
|
||||
var irrigations = farmInput.CropFields[0].HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].Irrigation;
|
||||
if (!string.IsNullOrEmpty(irrigations))
|
||||
{
|
||||
var irrigationArray = irrigations.Split(',');
|
||||
if (irrigationArray.Length > i)
|
||||
{
|
||||
irrigation = string.IsNullOrEmpty(irrigationArray[i]) ? 0 : Convert.ToInt16(irrigationArray[i]);
|
||||
}
|
||||
}
|
||||
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + irrigation;
|
||||
result = result < 0 ? result : 0;
|
||||
result = result < smdMaxValue ? smdMaxValue : result;
|
||||
valueList.Add(new ColumnValue("M1", result));
|
||||
@@ -799,7 +870,17 @@ namespace FarmMapsAPI.Carbon
|
||||
smdMaxValue = smdMax[climateItem.Key] / 1.8;
|
||||
}
|
||||
|
||||
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value;
|
||||
var irrigation = 0;
|
||||
var irrigations = farmInput.CropFields[0].HistoricalCropData.SingleOrDefault(x => x.Year == loopYear).Crops[0].Irrigation;
|
||||
if (!string.IsNullOrEmpty(irrigations))
|
||||
{
|
||||
var irrigationArray = irrigations.Split(',');
|
||||
if (irrigationArray.Length > i)
|
||||
{
|
||||
irrigation = string.IsNullOrEmpty(irrigationArray[i]) ? 0 : Convert.ToInt16(irrigationArray[i]);
|
||||
}
|
||||
}
|
||||
var result = climateItem.Value[i].Precipitation - climateItem.Value[i].Evapotranspiration + valueList.SingleOrDefault(x => x.Key == $"M{i}").Value + irrigation;
|
||||
result = result < 0 ? result : 0;
|
||||
result = result < smdMaxValue ? smdMaxValue : result;
|
||||
valueList.Add(new ColumnValue($"M{i + 1}", result));
|
||||
@@ -874,7 +955,7 @@ namespace FarmMapsAPI.Carbon
|
||||
foreach (var field in cropAreaField1.Where(x => x.Key.Item2 == loopYear))
|
||||
{
|
||||
var valueList = new List<ColumnValue>();
|
||||
var result = parameterSet.LayerDepth * bulkDens[field.Key.Item1] * oM_Corr[field.Key.Item1] * 0.54;
|
||||
var result = parameterSet.LayerDepth * bulkDens[field.Key.Item1] * c_Corr[field.Key.Item1]; //(used to be oM_Corr[field.Key.Item1] * 0.54)
|
||||
foreach (var crop in field.Value)
|
||||
{
|
||||
valueList.Add(new ColumnValue(crop.Key, result));
|
||||
@@ -912,7 +993,7 @@ namespace FarmMapsAPI.Carbon
|
||||
var carbonGreenManure = carbonInput.Value.SingleOrDefault(x => x.Key == "CarbonGreenManure")?.Value ?? 0;
|
||||
var resultRpm = 0.0;
|
||||
var resultDpm = 0.0;
|
||||
if (cropSet.Perennial.Any(x=>x.ToLower() == carbonInput.Key.Item3.ToLower()))
|
||||
if (cropSet.Perennial.Any(x => x.ToLower() == carbonInput.Key.Item3.ToLower()))
|
||||
{
|
||||
resultRpm = (carbonResidues) * 0.6;
|
||||
resultDpm = (carbonResidues) * 0.4;
|
||||
@@ -1407,7 +1488,7 @@ namespace FarmMapsAPI.Carbon
|
||||
// DPMss
|
||||
// RPMss
|
||||
// IOMss
|
||||
|
||||
|
||||
var dpmSs = new Dictionary<(string, int), List<ColumnValue>>();
|
||||
var rpmSs = new Dictionary<(string, int), List<ColumnValue>>();
|
||||
var iomSs = new Dictionary<(string, int), List<ColumnValue>>();
|
||||
@@ -1620,7 +1701,7 @@ namespace FarmMapsAPI.Carbon
|
||||
summary.Initial = sum;
|
||||
}
|
||||
|
||||
foreach(var item in bulkDens)
|
||||
foreach (var item in bulkDens)
|
||||
{
|
||||
var result = item.Value;
|
||||
foreach (var lYear in allYears)
|
||||
@@ -1683,7 +1764,7 @@ namespace FarmMapsAPI.Carbon
|
||||
var iniValue = item.Value.SingleOrDefault(x => x.Key == "IniCcontent")?.Value ?? 0;
|
||||
var balanceValue = item.Value.SingleOrDefault(x => x.Key == "Balance")?.Value ?? 0;
|
||||
|
||||
var resultOmIni = iniValue / 0.54;
|
||||
var resultOmIni = iniValue / 0.54; //carbon_organicmatter_factor
|
||||
var resultCo2 = balanceValue * (44.0 / 12.0);
|
||||
|
||||
item.Value.Add(new ColumnValue("OM_ini", resultOmIni));
|
||||
@@ -1702,7 +1783,7 @@ namespace FarmMapsAPI.Carbon
|
||||
var greenManure = item.SOC_CarbonGreenManure;
|
||||
var compost = item.SOC_CarbonCompost;
|
||||
|
||||
item.OM_ini = iniValue / 0.54;
|
||||
item.OM_ini = iniValue / 0.54; //carbon_organicmatter_factor
|
||||
item.CO2seq = balanceValue * (44.0 / 12.0);
|
||||
|
||||
var emision = -1 * (manure + residues + greenManure + compost - balanceValue);
|
||||
@@ -1731,7 +1812,7 @@ namespace FarmMapsAPI.Carbon
|
||||
var sumIni = 0.0;
|
||||
var sumInicc = 0.0;
|
||||
|
||||
foreach (var item in soc_Summary.Where(x=>x.Key.Item2 == farm.Key.Item2))
|
||||
foreach (var item in soc_Summary.Where(x => x.Key.Item2 == farm.Key.Item2))
|
||||
{
|
||||
var cropfieldArea = item.Value.SingleOrDefault(x => x.Key == "Total_crop_area")?.Value ?? 0;
|
||||
sumCarbonMan += item.Value.SingleOrDefault(x => x.Key == "SOC_CarbonManure")?.Value ?? 0;
|
||||
@@ -1756,7 +1837,7 @@ namespace FarmMapsAPI.Carbon
|
||||
var resultBal = sumBal / farmArea.Total_crop_area;
|
||||
var resultIni = sumIni / farmArea.Total_crop_area;
|
||||
var resultiniCc = sumInicc / farmArea.Total_crop_area;
|
||||
var resultOm_Ini = resultiniCc / 0.54;
|
||||
var resultOm_Ini = resultiniCc / 0.54; //carbon_organicmatter_factor
|
||||
var resultCo2 = resultBal * (44.0 / 12.0);
|
||||
var resultCo2Tot = resultCo2 * farmArea.Total_crop_area;
|
||||
|
||||
@@ -1785,7 +1866,7 @@ namespace FarmMapsAPI.Carbon
|
||||
private List<int> GetYears(FarmInputsetsModel farmInputSet, CarbonRequest farmInput)
|
||||
{
|
||||
// assume for all cropfields the same years apply
|
||||
return farmInput.CropFields.First().HistoricalCropData.Select(x => x.Year).Distinct().OrderBy(o=>o).ToList();
|
||||
return farmInput.CropFields.First().HistoricalCropData.Select(x => x.Year).Distinct().OrderBy(o => o).ToList();
|
||||
}
|
||||
|
||||
private Dictionary<string, List<string>> GetSoilTypeData(CarbonRequest farmInput)
|
||||
@@ -1803,7 +1884,8 @@ namespace FarmMapsAPI.Carbon
|
||||
var soilPropertiesField = new Dictionary<string, SoilPropertyType>();
|
||||
foreach (var field in farmInput.CropFields)
|
||||
{
|
||||
soilPropertiesField.Add(field.Name, new SoilPropertyType { OM_Cont = field.SoilProperty.OM_Const.Value, Clay_Content = field.SoilProperty.Clay_Content.Value, OM_Corr = field.SoilProperty.OM_Const.Value <= 20 ? field.SoilProperty.OM_Const.Value : 0, Depth10 = field.SoilProperty.Depth10.Value });
|
||||
//soilPropertiesField.Add(field.Name, new SoilPropertyType { OM_Cont = field.SoilProperty.OM_Choice.ToLower() == "c" ? field.SoilProperty.OM_Const.Value * 1.85185 : field.SoilProperty.OM_Const.Value, Clay_Content = field.SoilProperty.Clay_Content.Value, OM_Corr = field.SoilProperty.OM_Const.Value <= 20 ? field.SoilProperty.OM_Const.Value : 0, Depth10 = field.SoilProperty.Depth10.Value, Depth = field.SoilProperty.Depth });
|
||||
soilPropertiesField.Add(field.Name, new SoilPropertyType { OM_Cont = field.SoilProperty.OM_Const.HasValue ? field.SoilProperty.OM_Const.Value : 0, C_Cont = field.SoilProperty.C_Const.HasValue ? field.SoilProperty.C_Const.Value : 0, Clay_Content = field.SoilProperty.Clay_Content.Value, OM_Corr = field.SoilProperty.OM_Const.HasValue && field.SoilProperty.OM_Const.Value <= 20 ? field.SoilProperty.OM_Const.Value : 0, C_Corr = field.SoilProperty.C_Const.HasValue && field.SoilProperty.C_Const.Value <= 10.8 ? field.SoilProperty.C_Const.Value : 0, Depth10 = field.SoilProperty.Depth10.Value, Depth = field.SoilProperty.Depth });
|
||||
}
|
||||
|
||||
return soilPropertiesField;
|
||||
@@ -1816,7 +1898,7 @@ namespace FarmMapsAPI.Carbon
|
||||
{
|
||||
foreach (var item2 in item.Value)
|
||||
{
|
||||
soilPropSoilType.Add((item.Key, item2), new SoilPropertyType { Bulk_Density = soilPropertiesField[item.Key].Bulk_Density, Clay_Content = soilPropertiesField[item.Key].Clay_Content, OM_Cont = soilPropertiesField[item.Key].OM_Cont, OM_Corr = soilPropertiesField[item.Key].OM_Corr }); // soilPropertiesField[item.Key]);
|
||||
soilPropSoilType.Add((item.Key, item2), new SoilPropertyType { Bulk_Density = soilPropertiesField[item.Key].Bulk_Density, Clay_Content = soilPropertiesField[item.Key].Clay_Content, OM_Cont = soilPropertiesField[item.Key].OM_Cont, OM_Corr = soilPropertiesField[item.Key].OM_Corr, C_Cont = soilPropertiesField[item.Key].C_Cont, C_Corr = soilPropertiesField[item.Key].C_Corr }); // soilPropertiesField[item.Key]);
|
||||
}
|
||||
}
|
||||
return soilPropSoilType;
|
||||
@@ -1871,7 +1953,7 @@ namespace FarmMapsAPI.Carbon
|
||||
return soilBulkDensities;
|
||||
}
|
||||
|
||||
private static Dictionary<string, List<ClimateVariable>> GetClimateVariable(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput)
|
||||
private Dictionary<(string, string, int), ClimateVariable> InitClimateFile(string knmiFile, string climateFile = null, int climateScenarioNumber = 0)
|
||||
{
|
||||
var data = new List<string>();
|
||||
using (StreamReader r = new StreamReader(knmiFile))
|
||||
@@ -1884,36 +1966,202 @@ namespace FarmMapsAPI.Carbon
|
||||
}
|
||||
|
||||
|
||||
var farmPostalCode = farmInput.PostalCode;
|
||||
if (farmInput.geometry != null)
|
||||
var dataClimate = new List<string>();
|
||||
if (climateFile != null && climateScenarioNumber > 0)
|
||||
{
|
||||
// determine poatalcode from geometry
|
||||
string res = GetPostalCodeFromGeometry(farmInput.geometry);
|
||||
farmPostalCode = 8211;
|
||||
using (StreamReader r = new StreamReader(climateFile))
|
||||
{
|
||||
string line;
|
||||
while ((line = r.ReadLine()) != null)
|
||||
{
|
||||
dataClimate.Add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// climate (zone, month, year)
|
||||
var climate = new Dictionary<(string, string, int), ClimateVariable>();
|
||||
|
||||
if (dataClimate.Count() > 0)
|
||||
{
|
||||
foreach (var row in dataClimate)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || row.Split(';')[0] == "KNMI_zone")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
if (int.Parse(rowArr[3]) == climateScenarioNumber)
|
||||
{
|
||||
climate.Add(($"zone{rowArr[0]}", $"M{rowArr[2]}", int.Parse(rowArr[1])), new ClimateVariable(double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture), double.Parse(rowArr[6], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var row in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
if (int.Parse(rowArr[2]) <= 2023)
|
||||
{
|
||||
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
|
||||
{
|
||||
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Temperature = double.Parse(rowArr[3], CultureInfo.InvariantCulture);
|
||||
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Precipitation = double.Parse(rowArr[4], CultureInfo.InvariantCulture);
|
||||
climate[(rowArr[0], rowArr[1], int.Parse(rowArr[2]))].Evapotranspiration = double.Parse(rowArr[5], CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var row in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
|
||||
return climate;
|
||||
}
|
||||
|
||||
private static Dictionary<string, List<ClimateVariable>> GetClimateVariable2(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput, string climateFile = null, int climateScenarioNumber = 0, Dictionary<(string, string, int), ClimateVariable> climate = null)
|
||||
{
|
||||
var climateVariable = new Dictionary<string, List<ClimateVariable>>();
|
||||
|
||||
var farmPostalCode = farmInput.PostalCode;
|
||||
//if (farmInput.geometry != null)
|
||||
//{
|
||||
// // determine poatalcode from geometry
|
||||
// string res = GetPostalCodeFromGeometry(farmInput.geometry);
|
||||
// farmPostalCode = 8211;
|
||||
//}
|
||||
var farmZone = dataTransformationSet.KNMI_zone_Reg.SingleOrDefault(x => x.Reg.Contains(farmPostalCode)).KNMI_zone;
|
||||
foreach (var field in farmInput.CropFields.Select(s => s.Name))
|
||||
{
|
||||
var monthClimateList = new List<ClimateVariable>();
|
||||
foreach (var month in gisSoilSet.AllMonths)
|
||||
{
|
||||
var climateYear = loopYear > 2050 || loopYear < 2011 ? 2012 : loopYear;
|
||||
var monthData = climate.Single(x => x.Key.Item1 == farmZone && x.Key.Item2 == month && x.Key.Item3 == climateYear).Value;
|
||||
var newMonthData = new ClimateVariable(monthData.Temperature, monthData.Precipitation, monthData.Evapotranspiration * 1.25);
|
||||
monthClimateList.Add(newMonthData);
|
||||
}
|
||||
climateVariable.Add(field, monthClimateList);
|
||||
}
|
||||
|
||||
return climateVariable;
|
||||
|
||||
}
|
||||
|
||||
private static Dictionary<string, List<ClimateVariable>> GetClimateVariable(string knmiFile, SetsForDataTransformation dataTransformationSet, GIS_Soils_Sets gisSoilSet, int loopYear, CarbonRequest farmInput, string climateFile = null, int climateScenarioNumber = 0)
|
||||
{
|
||||
var data = new List<string>();
|
||||
using (StreamReader r = new StreamReader(knmiFile))
|
||||
{
|
||||
string line;
|
||||
while ((line = r.ReadLine()) != null)
|
||||
{
|
||||
data.Add(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var dataClimate = new List<string>();
|
||||
if (climateFile != null && climateScenarioNumber > 0)
|
||||
{
|
||||
using (StreamReader r = new StreamReader(climateFile))
|
||||
{
|
||||
string line;
|
||||
while ((line = r.ReadLine()) != null)
|
||||
{
|
||||
dataClimate.Add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var farmPostalCode = farmInput.PostalCode;
|
||||
//if (farmInput.geometry != null)
|
||||
//{
|
||||
// // determine poatalcode from geometry
|
||||
// string res = GetPostalCodeFromGeometry(farmInput.geometry);
|
||||
// farmPostalCode = 8211;
|
||||
//}
|
||||
|
||||
var farmZone = dataTransformationSet.KNMI_zone_Reg.SingleOrDefault(x => x.Reg.Contains(farmPostalCode)).KNMI_zone;
|
||||
// climate (zone, month, year)
|
||||
var climate = new Dictionary<(string, string, int), ClimateVariable>();
|
||||
|
||||
foreach (var row in data)
|
||||
if (dataClimate.Count() > 0)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
|
||||
foreach (var row in dataClimate)
|
||||
{
|
||||
continue;
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || row.Split(';')[0] == "KNMI_zone")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
if (int.Parse(rowArr[3]) == climateScenarioNumber)
|
||||
{
|
||||
climate.Add(($"zone{rowArr[0]}", $"M{rowArr[2]}", int.Parse(rowArr[1])), new ClimateVariable(double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture), double.Parse(rowArr[6], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var row in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
if (climate.Any(x => x.Key.Item1 == rowArr[0] && x.Key.Item2 == rowArr[1] && x.Key.Item3 == int.Parse(rowArr[2])))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var row in data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(row) || row.Split(';').Length == 0 || string.IsNullOrEmpty(row.Split(';')[0]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var rowArr = row.Split(';');
|
||||
climate.Add((rowArr[0], rowArr[1], int.Parse(rowArr[2])), new ClimateVariable(double.Parse(rowArr[3], CultureInfo.InvariantCulture), double.Parse(rowArr[4], CultureInfo.InvariantCulture), double.Parse(rowArr[5], CultureInfo.InvariantCulture)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var climateVariable = new Dictionary<string, List<ClimateVariable>>();
|
||||
|
||||
foreach (var field in farmInput.CropFields.Select(s=>s.Name))
|
||||
foreach (var field in farmInput.CropFields.Select(s => s.Name))
|
||||
{
|
||||
var monthClimateList = new List<ClimateVariable>();
|
||||
foreach (var month in gisSoilSet.AllMonths)
|
||||
{
|
||||
var climateYear = loopYear > 2020 || loopYear < 2011 ? 2012 : loopYear;
|
||||
var climateYear = loopYear > 2050 || loopYear < 2011 ? 2012 : loopYear;
|
||||
var monthData = climate.Single(x => x.Key.Item1 == farmZone && x.Key.Item2 == month && x.Key.Item3 == climateYear).Value;
|
||||
var newMonthData = new ClimateVariable(monthData.Temperature, monthData.Precipitation, monthData.Evapotranspiration * 1.25);
|
||||
monthClimateList.Add(newMonthData);
|
||||
@@ -1965,40 +2213,40 @@ namespace FarmMapsAPI.Carbon
|
||||
return carbonInputGreenManure;
|
||||
}
|
||||
|
||||
private static string GetPostalCodeFromGeometry(NetTopologySuite.Geometries.Geometry geometry)
|
||||
{
|
||||
//// Set crs default geometry factory to EPSG:4326
|
||||
NetTopologySuite.NtsGeometryServices.Instance = new NetTopologySuite.NtsGeometryServices(NetTopologySuite.Geometries.Implementation.CoordinateArraySequenceFactory.Instance,
|
||||
new PrecisionModel(PrecisionModels.Floating), 4326);
|
||||
// Register all vector drivers
|
||||
Ogr.RegisterAll();
|
||||
//private static string GetPostalCodeFromGeometry(NetTopologySuite.Geometries.Geometry geometry)
|
||||
//{
|
||||
// //// Set crs default geometry factory to EPSG:4326
|
||||
// NetTopologySuite.NtsGeometryServices.Instance = new NetTopologySuite.NtsGeometryServices(NetTopologySuite.Geometries.Implementation.CoordinateArraySequenceFactory.Instance,
|
||||
// new PrecisionModel(PrecisionModels.Floating), 4326);
|
||||
// // Register all vector drivers
|
||||
// Ogr.RegisterAll();
|
||||
|
||||
// item.geometry is always in WGS84 so reproject to EPSG:28992
|
||||
var localReference = new LocalReference("EPSG:28992");
|
||||
var localGeometry = localReference.ToLocalPolygon(geometry as Polygon);
|
||||
// // item.geometry is always in WGS84 so reproject to EPSG:28992
|
||||
// var localReference = new LocalReference("EPSG:28992");
|
||||
// var localGeometry = localReference.ToLocalPolygon(geometry as Polygon);
|
||||
|
||||
// get postal code from shape file
|
||||
// open shape file
|
||||
using (var postalcodes = Ogr.Open("config/PC4/PC4.shp", 0))
|
||||
{
|
||||
// get first layer
|
||||
var pc4Layer = postalcodes.GetLayerByIndex(0);
|
||||
// // get postal code from shape file
|
||||
// // open shape file
|
||||
// using (var postalcodes = Ogr.Open("config/PC4/PC4.shp", 0))
|
||||
// {
|
||||
// // get first layer
|
||||
// var pc4Layer = postalcodes.GetLayerByIndex(0);
|
||||
|
||||
// set spatial filter to geometry ( only intersecting features are retrieved )
|
||||
pc4Layer.SetSpatialFilter(localGeometry.Centroid.ToOGRGeometry());
|
||||
// // set spatial filter to geometry ( only intersecting features are retrieved )
|
||||
// pc4Layer.SetSpatialFilter(localGeometry.Centroid.ToOGRGeometry());
|
||||
|
||||
// get next feature
|
||||
var pc4Feature = pc4Layer.GetNextFeature();
|
||||
// // get next feature
|
||||
// var pc4Feature = pc4Layer.GetNextFeature();
|
||||
|
||||
// if feature retrieved get the PC4 attribute from it
|
||||
if (pc4Feature is object)
|
||||
{
|
||||
return pc4Feature.GetFieldAsString("PC4");
|
||||
}
|
||||
}
|
||||
// // if feature retrieved get the PC4 attribute from it
|
||||
// if (pc4Feature is object)
|
||||
// {
|
||||
// return pc4Feature.GetFieldAsString("PC4");
|
||||
// }
|
||||
// }
|
||||
|
||||
return "";
|
||||
}
|
||||
// return "";
|
||||
//}
|
||||
|
||||
private string MapSoil(string soil)
|
||||
{
|
||||
@@ -2014,5 +2262,29 @@ namespace FarmMapsAPI.Carbon
|
||||
}
|
||||
}
|
||||
|
||||
private static double CalculateMedian(List<double> numbers)
|
||||
{
|
||||
if (numbers == null || numbers.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("The list is empty or null.");
|
||||
}
|
||||
|
||||
numbers.Sort();
|
||||
|
||||
int count = numbers.Count;
|
||||
if (count % 2 == 0)
|
||||
{
|
||||
// Even number of elements
|
||||
double mid1 = numbers[count / 2 - 1];
|
||||
double mid2 = numbers[count / 2];
|
||||
return (mid1 + mid2) / 2.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Odd number of elements
|
||||
return numbers[count / 2];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
2381
CarbonLib/CarbonCalculation25.cs
Normal file
2381
CarbonLib/CarbonCalculation25.cs
Normal file
File diff suppressed because it is too large
Load Diff
16
CarbonLib/CarbonLib.csproj
Normal file
16
CarbonLib/CarbonLib.csproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<AssemblyName>CarbonLib</AssemblyName>
|
||||
<PackageId>CarbonLib</PackageId>
|
||||
<RuntimeIdentifiers>win-x64;linux-x64;linux-musl-x64</RuntimeIdentifiers>
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
||||
<Version>4.19.4</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NetTopologySuite" Version="2.5.0" />
|
||||
<PackageReference Include="NetTopologySuite.IO.GeoJSON" Version="3.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -5,7 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon
|
||||
namespace CarbonLib.Carbon
|
||||
{
|
||||
public class GamsSets
|
||||
{
|
||||
13
CarbonLib/Helper.cs
Normal file
13
CarbonLib/Helper.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System.IO;
|
||||
|
||||
namespace CarbonLib
|
||||
{
|
||||
public class Helper
|
||||
{
|
||||
public static string GetPlatformIndependentDirectoryPath(string path)
|
||||
{
|
||||
return path.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
19
CarbonLib/ICarbonCalculation.cs
Normal file
19
CarbonLib/ICarbonCalculation.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using CarbonService.Models;
|
||||
using CarbonLib.Carbon.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CarbonLib.Carbon
|
||||
{
|
||||
public interface ICarbonCalculation
|
||||
{
|
||||
string Validate(CarbonRequest farmInput);
|
||||
CarbonRequest MapFarmMapsToMiterra(FarmMapsCarbonRequest farmInput);
|
||||
CarbonSummary Calculate(CarbonRequest farmInput);
|
||||
CarbonSummary CalculateClimateScenario(CarbonRequest farmInput);
|
||||
double? GetCropYield(string cropCode, int year, int postalCode);
|
||||
}
|
||||
}
|
||||
@@ -30,14 +30,17 @@ namespace CarbonService.Models
|
||||
public SoilProperty SoilProperty { get; set; }
|
||||
[Required]
|
||||
public List<HistoricalCropData> HistoricalCropData { get; set; }
|
||||
public List<GreenManure> GreenManures { get; set; }
|
||||
public List<GreenManure> GreenManures { get; set; }
|
||||
}
|
||||
|
||||
public class SoilProperty
|
||||
{
|
||||
public double? OM_Const { get; set; }
|
||||
public double? C_Const { get; set; }
|
||||
public string OM_Choice { get; set; }
|
||||
public double? Clay_Content { get; set; }
|
||||
public bool? Depth10 { get; set; }
|
||||
public int? Depth { get; set; }
|
||||
}
|
||||
|
||||
public class OrgManureApplied
|
||||
@@ -49,6 +52,7 @@ namespace CarbonService.Models
|
||||
public List<OrganicManureType> OrganicManures { get; set; }
|
||||
public double? CropYield { get { return (int?)yield; } set { yield = value; } }
|
||||
public bool CropRes { get; set; }
|
||||
public string Irrigation { get; set; }
|
||||
}
|
||||
|
||||
public class OrganicManureType
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class CarbonSummary
|
||||
{
|
||||
@@ -11,6 +11,14 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public List<CropFieldSummary> CropField { get; set; }
|
||||
}
|
||||
|
||||
public class CarbonSummaryList
|
||||
{
|
||||
[JsonProperty("cropFieldClimate")]
|
||||
public List<CropFieldSummaryList> CropFieldClimate { get; set; }
|
||||
[JsonProperty("cropField")]
|
||||
public CarbonSummary CarbonSummary { get; set; }
|
||||
}
|
||||
|
||||
public class CropFieldSummary
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
@@ -19,6 +27,14 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public List<YearSummary> Summary { get; set; }
|
||||
}
|
||||
|
||||
public class CropFieldSummaryList
|
||||
{
|
||||
[JsonProperty("name")]
|
||||
public string Name { get; set; }
|
||||
[JsonProperty("summary")]
|
||||
public List<YearSummaryClimate> SummaryList { get; set; }
|
||||
}
|
||||
|
||||
public class YearSummary
|
||||
{
|
||||
[JsonProperty("crop")]
|
||||
@@ -37,6 +53,8 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public double IniCcontent { get; set; }
|
||||
[JsonProperty("oM_ini")]
|
||||
public double OM_ini { get; set; }
|
||||
[JsonProperty("oM_ini_Climate")]
|
||||
public List<double> OM_ini_Climate { get; set; }
|
||||
[JsonProperty("cO2seq")]
|
||||
public double CO2seq { get; set; }
|
||||
[JsonProperty("soC_CarbonCompost")]
|
||||
@@ -51,6 +69,39 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public double Emision { get; set; }
|
||||
}
|
||||
|
||||
public class YearSummaryClimate
|
||||
{
|
||||
[JsonProperty("crop")]
|
||||
public string Crop { get; set; }
|
||||
[JsonProperty("year")]
|
||||
public int Year { get; set; }
|
||||
[JsonProperty("bulk_Density")]
|
||||
public List<double> Bulk_Density { get; set; }
|
||||
[JsonProperty("total_crop_area")]
|
||||
public double Total_crop_area { get; set; }
|
||||
[JsonProperty("balance")]
|
||||
public List<double> Balance { get; set; }
|
||||
[JsonProperty("initial")]
|
||||
public List<double> Initial { get; set; }
|
||||
[JsonProperty("iniCcontent")]
|
||||
public List<double> IniCcontent { get; set; }
|
||||
[JsonProperty("oM_ini")]
|
||||
public List<double> OM_ini { get; set; }
|
||||
[JsonProperty("cO2seq")]
|
||||
public List<double> CO2seq { get; set; }
|
||||
[JsonProperty("soC_CarbonCompost")]
|
||||
public List<double> SOC_CarbonCompost { get; set; }
|
||||
[JsonProperty("soC_CarbonGreenManure")]
|
||||
public List<double> SOC_CarbonGreenManure { get; set; }
|
||||
[JsonProperty("soC_CarbonResidues")]
|
||||
public List<double> SOC_CarbonResidues { get; set; }
|
||||
[JsonProperty("soC_CarbonManure")]
|
||||
public List<double> SOC_CarbonManure { get; set; }
|
||||
[JsonProperty("emision")]
|
||||
public List<double> Emision { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class FarmYearSummary
|
||||
{
|
||||
[JsonProperty("year")]
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class ClimateVariable
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class ColumnValue
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class CropCoverMonthsModel
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class CropPropertyModel
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class StrawCrp
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class YearData
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class ManureSourcesLiv
|
||||
{
|
||||
@@ -9,10 +9,11 @@ using System.Runtime.Serialization;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class FarmMapsCarbonRequest
|
||||
{
|
||||
public string ModelYear { get; set; }
|
||||
public string ScenarioName { get; set; }
|
||||
public int PostalCode { get; set; }
|
||||
|
||||
@@ -20,6 +21,9 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
|
||||
//added
|
||||
public int CalculateUntil { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public int CalculateFrom { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class CropFieldFarmMaps
|
||||
@@ -30,10 +34,11 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public double Area { get; set; }
|
||||
[Required]
|
||||
public string SoilType { get; set; }
|
||||
public string SoilTypeDefault { get; set; }
|
||||
[Required]
|
||||
public SoilPropertyFarmMaps SoilProperty { get; set; }
|
||||
[Required]
|
||||
public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; }
|
||||
public List<HistoricalCropDataFarmMaps> HistoricalCropData { get; set; }
|
||||
}
|
||||
|
||||
public class HistoricalCropDataFarmMaps
|
||||
@@ -44,6 +49,7 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
public List<CropData> Crops { get; set; }
|
||||
public List<GreenManureTypeFarmMaps> GreenManures { get; set; }
|
||||
public bool Rotation { get; set; }
|
||||
public string Irrigations { get; set; }
|
||||
|
||||
public HistoricalCropDataFarmMaps DeepCopy()
|
||||
{
|
||||
@@ -69,14 +75,27 @@ namespace FarmMapsAPI.Carbon.Models
|
||||
[Required]
|
||||
public string Type { get; set; }
|
||||
[Required]
|
||||
public double Quantity { get; set; }
|
||||
public double? Quantity { get; set; }
|
||||
}
|
||||
|
||||
public class SoilPropertyFarmMaps
|
||||
{
|
||||
public double? OM_Const { get; set; }
|
||||
public double? C_Const { get; set; }
|
||||
public double? OM_ConstDefault { get; set; }
|
||||
public string OM_Choice { get; set; }
|
||||
public double? Clay_Content { get; set; }
|
||||
public double? Clay_ContentDefault { get; set; }
|
||||
public bool Depth10 { get; set; }
|
||||
public int? Depth { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<OrganicMatterFarmMaps> OrganicMatters { get; set; }
|
||||
}
|
||||
|
||||
public class OrganicMatterFarmMaps
|
||||
{
|
||||
public int Year { get; set; }
|
||||
public double OrganicMatter { get; set; }
|
||||
}
|
||||
|
||||
public class GreenManureTypeFarmMaps
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class GIS_Soils_Sets
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class GamsThreeKeyParameter
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class ManCcontModel
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class MappingCropFarmmapsMiterraRothC
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class MappingGreenManureFarmmapsMiterraRothC
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class ParameterSet
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class KNMIZoneReg
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class SoilBulkDensityType
|
||||
{
|
||||
@@ -2,15 +2,17 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class SoilPropertyType
|
||||
{
|
||||
public double OM_Cont { get; set; }
|
||||
public double OM_Corr { get; set; }
|
||||
public double C_Cont { get; set; }
|
||||
public double C_Corr { get; set; }
|
||||
public double Bulk_Density { get; set; }
|
||||
public double Clay_Content { get; set; }
|
||||
public double Depth { get; set; }
|
||||
public int? Depth { get; set; }
|
||||
public bool Depth10 { get; set; }
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace FarmMapsAPI.Carbon.Models
|
||||
namespace CarbonLib.Carbon.Models
|
||||
{
|
||||
public class YieldGreenManureModel
|
||||
{
|
||||
50
Jenkinsfile
vendored
50
Jenkinsfile
vendored
@@ -1,42 +1,30 @@
|
||||
@Library('farmmaps-shared-library') _
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
APP_VERSION_PREFIX=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/Version" -v . -n|awk -v def="1.0.0" "{print} END { if(NR==0) {print def} }"', returnStdout: true).trim()
|
||||
APP_NAME=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/AssemblyName" -v . -n|awk -v def="App" "{print tolower(\\$0)} END { if(NR==0) {print def} }"', returnStdout: true).trim()
|
||||
APP_VERSION="${APP_VERSION_PREFIX}"
|
||||
agent any;
|
||||
options {
|
||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
||||
disableConcurrentBuilds();
|
||||
}
|
||||
triggers {
|
||||
upstream(
|
||||
upstreamProjects: '/FarmMaps/Base.Core.Common.Geometry/master',
|
||||
threshold: hudson.model.Result.SUCCESS
|
||||
)
|
||||
}
|
||||
stages {
|
||||
stage('Dotnet Restore') {
|
||||
stage('BaseBuildAll') {
|
||||
steps {
|
||||
sh '''dotnet restore CarbonLib.csproj'''
|
||||
stepBaseBuildAll();
|
||||
}
|
||||
}
|
||||
stage('Dotnet Build') {
|
||||
steps {
|
||||
sh '''dotnet build CarbonLib.csproj'''
|
||||
}
|
||||
}
|
||||
stage('Dotnet Package') {
|
||||
steps {
|
||||
sh '''rm -rf nuget
|
||||
dotnet pack -c release -o nuget -p:PackageVersion=${APP_VERSION} CarbonLib.csproj'''
|
||||
}
|
||||
}
|
||||
stage('Dotnet Publish') {
|
||||
steps {
|
||||
sh '''dotnet nuget push nuget/*.nupkg -k 0c3e3afc-935b-3db1-b023-e0d4799e674d -s https://repository.akkerweb.nl/repository/nuget-hosted/'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
postSuccess();
|
||||
}
|
||||
always {
|
||||
emailext (
|
||||
body: '${DEFAULT_CONTENT}',
|
||||
mimeType: 'text/html',
|
||||
replyTo: '${DEFAULT_REPLYTO}',
|
||||
subject: '${DEFAULT_SUBJECT}',
|
||||
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||
)
|
||||
postAlways();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,30 @@
|
||||
@Library('farmmaps-shared-library') _
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
environment {
|
||||
APP_VERSION_PREFIX=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/Version" -v . -n|awk -v def="1.0.0" "{print} END { if(NR==0) {print def} }"', returnStdout: true).trim()
|
||||
APP_NAME=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/AssemblyName" -v . -n|awk -v def="App" "{print tolower(\\$0)} END { if(NR==0) {print def} }"', returnStdout: true).trim()
|
||||
APP_VERSION="${APP_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
|
||||
agent any;
|
||||
options {
|
||||
copyArtifactPermission projectNames: env.allProjectsArtifactPermission;
|
||||
disableConcurrentBuilds();
|
||||
}
|
||||
triggers {
|
||||
upstream(
|
||||
upstreamProjects: '/FarmMaps.Develop/Base.Core.Common.Geometry/develop',
|
||||
threshold: hudson.model.Result.SUCCESS
|
||||
)
|
||||
}
|
||||
stages {
|
||||
stage('Dotnet Restore') {
|
||||
stage('BaseBuildAll') {
|
||||
steps {
|
||||
sh '''dotnet restore CarbonLib.csproj'''
|
||||
stepBaseBuildAll();
|
||||
}
|
||||
}
|
||||
stage('Dotnet Build'){
|
||||
steps {
|
||||
sh '''dotnet build CarbonLib.csproj'''
|
||||
}
|
||||
}
|
||||
stage('Dotnet Package') {
|
||||
steps {
|
||||
sh '''rm -rf nuget
|
||||
dotnet pack -c debug -o nuget -p:PackageVersion=${APP_VERSION} CarbonLib.csproj'''
|
||||
}
|
||||
}
|
||||
stage('Dotnet Publish') {
|
||||
steps {
|
||||
sh '''dotnet nuget push nuget/*.nupkg -k 0c3e3afc-935b-3db1-b023-e0d4799e674d -s https://repository.akkerweb.nl/repository/nuget-hosted/'''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
postSuccess();
|
||||
}
|
||||
always {
|
||||
emailext (
|
||||
body: '${DEFAULT_CONTENT}',
|
||||
mimeType: 'text/html',
|
||||
replyTo: '${DEFAULT_REPLYTO}',
|
||||
subject: '${DEFAULT_SUBJECT}',
|
||||
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
|
||||
)
|
||||
postAlways();
|
||||
}
|
||||
}
|
||||
}
|
||||
16
NuGet.Config
16
NuGet.Config
@@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||
<clear />
|
||||
<add key="akkerweb" value="https://repository.akkerweb.nl/repository/nuget-group/" />
|
||||
<add key="NPGSQL Unstable" value="https://www.myget.org/F/npgsql-unstable/api/v3/index.json" />
|
||||
<add key="NetTopologySuite" value="https://www.myget.org/F/nettopologysuite/api/v3/index.json" />
|
||||
</packageSources>
|
||||
<packageSourceCredentials>
|
||||
<akkerweb>
|
||||
<add key="Username" value="akkerweb" />
|
||||
<add key="ClearTextPassword" value="1QTrg6g[*" />
|
||||
</akkerweb>
|
||||
</packageSourceCredentials>
|
||||
</configuration>
|
||||
22
README.md
22
README.md
@@ -1,2 +1,24 @@
|
||||
# CarbonLib
|
||||
|
||||
#
|
||||
|
||||
Library with model based on the scientifically acknowledged carbon model RothC.
|
||||
The code is written in C# .NET Core and it is adapted from a project written in GAMS.
|
||||
|
||||
Test console app is included with an example input request. The output in written to a file.
|
||||
|
||||
|
||||
## Building a sample
|
||||
|
||||
Build the sample using the .NET Core CLI, which is installed with [the .NET Core SDK](https://www.microsoft.com/net/download). Then run
|
||||
these commands from the CLI in the directory of the CarbonConsoleApp:
|
||||
|
||||
```console
|
||||
dotnet build
|
||||
dotnet run
|
||||
```
|
||||
|
||||
This will install any needed dependencies, build the project, and run
|
||||
the project respectively.
|
||||
|
||||
For questions regarding the model: chantal.hendriks@wur.nl
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,303 +0,0 @@
|
||||
[
|
||||
{
|
||||
"CropCode": "1020101",
|
||||
"CropName": "Wintertarwe",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "WinterGroen_Graan"
|
||||
},
|
||||
{
|
||||
"CropCode": "1020102",
|
||||
"CropName": "Wintergerst",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "WinterGroen_Graan"
|
||||
},
|
||||
{
|
||||
"CropCode": "1020103",
|
||||
"CropName": "Winterrogge",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Winterrogge"
|
||||
},
|
||||
{
|
||||
"CropCode": "1020201",
|
||||
"CropName": "Zomertarwe",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "WinterGroen_Graan"
|
||||
},
|
||||
{
|
||||
"CropCode": "1020202",
|
||||
"CropName": "Zomergerst",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "WinterGroen_Graan"
|
||||
},
|
||||
{
|
||||
"CropCode": "1020203",
|
||||
"CropName": "Zomerrogge",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Winterrogge"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030301",
|
||||
"CropName": "Alexandrijnse klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030302",
|
||||
"CropName": "Bastaard klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030303",
|
||||
"CropName": "Hopklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030304",
|
||||
"CropName": "Inkarnaatklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030305",
|
||||
"CropName": "Perzische klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030306",
|
||||
"CropName": "Rode klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030307",
|
||||
"CropName": "Rolklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030308",
|
||||
"CropName": "Witte honingklaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030309",
|
||||
"CropName": "Witte klaver",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030401",
|
||||
"CropName": "Blauwe Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030402",
|
||||
"CropName": "Gele Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030403",
|
||||
"CropName": "Witte Lupine",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030501",
|
||||
"CropName": "Voederwikke",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030502",
|
||||
"CropName": "Bonte wikke",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1030602",
|
||||
"CropName": "Hanekam",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040101",
|
||||
"CropName": "Stoppelknol",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040102",
|
||||
"CropName": "Bladrammenas",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Bladrammenas"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040103",
|
||||
"CropName": "Bruine mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Gele mosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040104",
|
||||
"CropName": "Gele mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Gele mosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040105",
|
||||
"CropName": "Zwarte mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Gele mosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040108",
|
||||
"CropName": "Bladkool",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Bladkool"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040109",
|
||||
"CropName": "Mergkool",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040110",
|
||||
"CropName": "Ethiopische mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Gele mosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040111",
|
||||
"CropName": "Serepta mosterd",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Gele mosterd"
|
||||
},
|
||||
{
|
||||
"CropCode": "1040112",
|
||||
"CropName": "Zwaardherik",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Zwaardherik"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050101",
|
||||
"CropName": "Engels raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050102",
|
||||
"CropName": "Frans raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050103",
|
||||
"CropName": "Gekruist raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050104",
|
||||
"CropName": "Italiaans raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050105",
|
||||
"CropName": "Trosraaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050106",
|
||||
"CropName": "Westerwolds raaigras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Italiaans raaigras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050201",
|
||||
"CropName": "Roodzwenkgras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Wintergroen_Gras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1050408",
|
||||
"CropName": "Sudangras",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Wintergroen_Gras"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080107",
|
||||
"CropName": "Facelia",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080108",
|
||||
"CropName": "Spurrie",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080109",
|
||||
"CropName": "Afrikaantjes",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
},
|
||||
{
|
||||
"CropCode": "1080110",
|
||||
"CropName": "Raketblad",
|
||||
"PurposeCode": "118",
|
||||
"PurposeName": "Groenbemesting",
|
||||
"MiterraRothCCrop": "Groenbemester"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user