diff --git a/Core.Tests/Charter/CurveDataConverterTests.cs b/Core.Tests/Charter/CurveDataConverterTests.cs
index d72c8b0..73c8fc8 100644
--- a/Core.Tests/Charter/CurveDataConverterTests.cs
+++ b/Core.Tests/Charter/CurveDataConverterTests.cs
@@ -14,13 +14,13 @@ namespace LeafWeb.Core.Tests.Charter
[Test]
public void Convert_Valid()
{
- var fileInfo = FileUtility.GetContentFile(ContentDirectory, "cntrlcomparison_Wild Capsicum.csv");
- CntrlComparison[] cntrlComparison;
- using (var parser = new CntrlComparisonParser(fileInfo))
- cntrlComparison = parser.Parse();
+ var fileInfo = FileUtility.GetContentFile(ContentDirectory, "leafgascomparison.csv");
+ LeafGasComparison[] leafGasComparisons;
+ using (var parser = new LeafGasComparisonParser(fileInfo))
+ leafGasComparisons = parser.Parse();
- var curves = CurveDataConverter.Convert(cntrlComparison);
- Assert.That(curves.Count(),Is.EqualTo(7));
+ var curves = CurveDataConverter.Convert(leafGasComparisons);
+ Assert.That(curves.Count(),Is.EqualTo(1));
}
}
}
\ No newline at end of file
diff --git a/Core.Tests/Core.Tests.csproj b/Core.Tests/Core.Tests.csproj
index 9b09a7b..7a59191 100644
--- a/Core.Tests/Core.Tests.csproj
+++ b/Core.Tests/Core.Tests.csproj
@@ -45,7 +45,7 @@
-
+
@@ -79,6 +79,9 @@
PreserveNewest
+
+ PreserveNewest
+
diff --git a/Core.Tests/Parsers/CntrlComparisonParserTests.cs b/Core.Tests/Parsers/LeafGasComparisonParserTests.cs
similarity index 56%
rename from Core.Tests/Parsers/CntrlComparisonParserTests.cs
rename to Core.Tests/Parsers/LeafGasComparisonParserTests.cs
index 9d1c381..53d8f22 100644
--- a/Core.Tests/Parsers/CntrlComparisonParserTests.cs
+++ b/Core.Tests/Parsers/LeafGasComparisonParserTests.cs
@@ -6,20 +6,20 @@ using NUnit.Framework;
namespace LeafWeb.Core.Tests.Parsers
{
[TestFixture]
- public class CntrlComparisonParserTests
+ public class LeafGasComparisonParserTests
{
private const string ContentDirectory = @"Parsers\LeafOutputData\";
[Test]
public void Parse_Valid()
{
- var fileInfo = FileUtility.GetContentFile(ContentDirectory, "cntrlcomparison_Wild Capsicum.csv");
+ var fileInfo = FileUtility.GetContentFile(ContentDirectory, "leafgascomparison.csv");
- CntrlComparison[] cntrlComparison;
- using (var parser = new CntrlComparisonParser(fileInfo))
- cntrlComparison = parser.Parse();
+ LeafGasComparison[] leafGasComparisons;
+ using (var parser = new LeafGasComparisonParser(fileInfo))
+ leafGasComparisons = parser.Parse();
- Assert.That(cntrlComparison.Length, Is.EqualTo(7 * 4));
+ Assert.That(leafGasComparisons.Length, Is.EqualTo(6));
}
}
}
diff --git a/Core.Tests/Parsers/LeafOutputData/leafgascomparison.csv b/Core.Tests/Parsers/LeafOutputData/leafgascomparison.csv
new file mode 100644
index 0000000..c03d62b
--- /dev/null
+++ b/Core.Tests/Parsers/LeafOutputData/leafgascomparison.csv
@@ -0,0 +1,218 @@
+CurveID,FitRwp|Rch|ha?,Fitha_Vcmax|Jmax|Tpu?,FitGamma*|ha?,FitKc|ha?,FitKo|ha?,FitRd|ha?,FitAlpha?,FitbetaPSII?,CO2i_obs,CO2i_Pred,CO2c,Anet_Obs,Anet_Pred,LimitState,RecycRate,CO2S,Pres_O2,Pres_H2O,Pres_Air,VPDL,PARi,LeafTemp,ChamberAirTemp,Trmmol,StomatalCond_H2O,ChlFlPHIPSII_Obs,ChlFlPHIPSII_Pred,CO2i_Pred_ChlFl,Anet_Pred_ChlFl,CO2c_CO2i_ChlFl,CO2c_Anet_ChlFl
+NA,1=No2=Yes,1=No2=Yes,1=No2=Yes,1=No2=Yes,1=No2=Yes,1=No2=Yes,1=No2=Yes,1=No2=Yes,Pa,Pa,Pa,umolm-2s-1,umolm-2s-1,Rubis1RUBP2TPU3,%,Pa,KPa,KPa,KPa,KPa,umolm-2s-1,oC,oC,mmolm-2s-1,molm-2s-1,NA,NA,Pa,umolm-2s-1,Pa,Pa
+371Jeq2.csv,111,111,11,11,11,11,1,2,4.421958,4.421958,4.421958,.105119,-.058361,1,67.475181,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.140056,-9999.000000,-.135919,-9999.000000,4.421958
+371Jeq2.csv,111,111,11,11,11,11,1,2,5.736168,5.736168,5.736168,1.246974,.913370,1,66.336977,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.152563,-9999.000000,.642059,-9999.000000,5.736168
+371Jeq2.csv,111,111,11,11,11,11,1,2,7.407605,7.407605,7.407605,2.874199,2.112027,1,65.117524,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.167853,-9999.000000,1.756981,-9999.000000,7.407605
+371Jeq2.csv,111,111,11,11,11,11,1,2,9.077730,9.077730,9.077730,4.141766,3.268355,1,64.133149,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.181167,-9999.000000,2.637460,-9999.000000,9.077730
+371Jeq2.csv,111,111,11,11,11,11,1,2,10.054763,10.054763,10.054763,5.600013,3.918280,1,63.441103,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.189701,-9999.000000,3.634466,-9999.000000,10.054763
+371Jeq2.csv,111,111,11,11,11,11,1,2,11.410662,11.410662,11.410662,8.376207,4.805849,1,62.219615,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.200859,-9999.000000,5.536633,-9999.000000,11.410662
+371Jeq2.csv,111,111,11,11,11,11,1,2,15.457426,15.457426,15.457426,12.050142,7.302670,1,61.764956,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.232402,-9999.000000,8.096547,-9999.000000,15.457426
+371Jeq2.csv,111,111,11,11,11,11,1,2,18.453370,18.453370,18.453370,14.865519,9.022162,1,61.310531,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.254357,-9999.000000,10.056079,-9999.000000,18.453370
+371Jeq2.csv,111,111,11,11,11,11,1,2,22.087725,22.087725,22.087725,16.534050,10.978689,1,61.664808,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.279175,-9999.000000,11.233259,-9999.000000,22.087725
+371Jeq2.csv,111,111,11,11,11,11,1,2,24.614529,24.614529,24.614529,17.634794,12.112298,2,63.065818,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.292440,-9999.000000,12.006024,-9999.000000,24.614529
+371Jeq2.csv,111,111,11,11,11,11,1,2,26.640135,26.640135,26.640135,18.362624,12.575439,2,64.529453,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.293357,-9999.000000,12.519131,-9999.000000,26.640135
+371Jeq2.csv,111,111,11,11,11,11,1,2,31.772055,31.772055,31.772055,19.571966,13.602852,2,66.952446,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.296728,-9999.000000,13.375418,-9999.000000,31.772055
+371Jeq2.csv,111,111,11,11,11,11,1,2,32.865828,32.865828,32.865828,19.783484,13.701403,2,63.738601,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.294709,-9999.000000,13.529335,-9999.000000,32.865828
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,1.000000,-2.805515,1.000000,-7.005258,-9999.000000,-9999.000000
+2.000000,2.000000,-1.991031,2.000000,-4.413796,-9999.000000,-9999.000000
+3.000000,3.000000,-1.196295,3.000000,-2.285153,-9999.000000,-9999.000000
+4.000000,4.000000,-.420598,4.000000,-.505507,-9999.000000,-9999.000000
+5.000000,5.000000,.336737,5.000000,1.004466,5.000000,20.229132
+6.000000,6.000000,1.076353,6.000000,2.301746,6.000000,20.229132
+8.500000,8.500000,2.851842,8.500000,4.865177,8.500000,20.229132
+11.000000,11.000000,4.529222,11.000000,6.761000,11.000000,20.229132
+13.500000,13.500000,6.116408,13.500000,8.219969,13.500000,20.229132
+16.000000,16.000000,7.620484,16.000000,9.377480,16.000000,20.229132
+18.500000,18.500000,9.047810,18.500000,10.318218,18.500000,20.229132
+21.000000,21.000000,10.404115,21.000000,11.097863,21.000000,20.229132
+23.500000,23.500000,11.694572,23.500000,11.754530,23.500000,20.229132
+26.000000,26.000000,12.923862,26.000000,12.315189,26.000000,20.229132
+28.500000,28.500000,14.096233,28.500000,12.799461,28.500000,20.229132
+31.000000,31.000000,15.215549,31.000000,13.221962,31.000000,20.229132
+33.500000,33.500000,16.285332,33.500000,13.593801,33.500000,20.229132
+36.000000,36.000000,17.308799,36.000000,13.923576,36.000000,20.229132
+38.500000,38.500000,18.288893,38.500000,14.218042,38.500000,20.229132
+41.000000,41.000000,19.228315,41.000000,14.482581,41.000000,20.229132
+43.500000,43.500000,20.129545,43.500000,14.721536,43.500000,20.229132
+
+371Jeq2.csv,111,111,21,21,11,11,1,2,4.421958,4.421958,4.421958,.105119,2.794410,1,72.459682,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.101685,-9999.000000,2.778067,-9999.000000,4.421958
+371Jeq2.csv,111,111,21,21,11,11,1,2,5.736168,5.736168,5.736168,1.246974,4.038513,1,71.648036,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.120939,-9999.000000,3.986989,-9999.000000,5.736168
+371Jeq2.csv,111,111,21,21,11,11,1,2,7.407605,7.407605,7.407605,2.874199,5.607761,1,70.822961,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.145195,-9999.000000,5.540331,-9999.000000,7.407605
+371Jeq2.csv,111,111,21,21,11,11,1,2,9.077730,9.077730,9.077730,4.141766,7.160696,1,70.212112,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.167971,-9999.000000,6.335544,-9999.000000,9.077730
+371Jeq2.csv,111,111,21,21,11,11,1,2,10.054763,10.054763,10.054763,5.600013,8.056523,1,69.736584,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.181867,-9999.000000,7.834671,-9999.000000,10.054763
+371Jeq2.csv,111,111,21,21,11,11,1,2,11.410662,11.410662,11.410662,8.376207,9.296236,1,68.849303,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.200887,-9999.000000,10.662909,-9999.000000,11.410662
+371Jeq2.csv,111,111,21,21,11,11,1,2,15.457426,15.457426,15.457426,12.050142,12.928805,1,69.077524,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.256636,-9999.000000,12.923490,-9999.000000,15.457426
+371Jeq2.csv,111,111,21,21,11,11,1,2,18.453370,18.453370,18.453370,14.865519,15.004833,2,68.344651,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.286696,-9999.000000,14.776539,-9999.000000,18.453370
+371Jeq2.csv,111,111,21,21,11,11,1,2,22.087725,22.087725,22.087725,16.534050,15.516809,2,65.972757,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.287624,-9999.000000,15.396967,-9999.000000,22.087725
+371Jeq2.csv,111,111,21,21,11,11,1,2,24.614529,24.614529,24.614529,17.634794,15.875870,2,66.047206,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.289791,-9999.000000,15.884568,-9999.000000,24.614529
+371Jeq2.csv,111,111,21,21,11,11,1,2,26.640135,26.640135,26.640135,18.362624,16.091246,2,67.184362,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.290700,-9999.000000,16.169224,-9999.000000,26.640135
+371Jeq2.csv,111,111,21,21,11,11,1,2,31.772055,31.772055,31.772055,19.571966,16.608589,2,68.986827,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.294045,-9999.000000,16.484454,-9999.000000,31.772055
+371Jeq2.csv,111,111,21,21,11,11,1,2,32.865828,32.865828,32.865828,19.783484,16.571480,2,65.755289,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.292041,-9999.000000,16.516952,-9999.000000,32.865828
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,1.000000,-.531271,1.000000,-1.391143,-9999.000000,-9999.000000
+2.000000,2.000000,.442145,2.000000,3.071039,2.000000,20.229132
+3.000000,3.000000,1.408958,3.000000,5.875193,3.000000,20.229132
+4.000000,4.000000,2.369235,4.000000,7.800649,4.000000,20.229132
+5.000000,5.000000,3.323041,5.000000,9.204478,5.000000,20.229132
+6.000000,6.000000,4.270441,6.000000,10.273366,6.000000,20.229132
+8.500000,8.500000,6.611340,8.500000,12.086154,8.500000,20.229132
+11.000000,11.000000,8.913588,11.000000,13.221646,11.000000,20.229132
+13.500000,13.500000,11.178134,13.500000,13.999671,13.500000,20.229132
+16.000000,16.000000,13.405896,16.000000,14.566075,16.000000,20.229132
+18.500000,18.500000,15.597764,18.500000,14.996863,18.500000,20.229132
+21.000000,21.000000,17.754598,21.000000,15.335533,21.000000,20.229132
+23.500000,23.500000,19.877232,23.500000,15.608779,23.500000,20.229132
+26.000000,26.000000,21.966472,26.000000,15.833888,26.000000,20.229132
+28.500000,28.500000,24.023101,28.500000,16.022551,28.500000,20.229132
+31.000000,31.000000,26.047876,31.000000,16.182957,31.000000,20.229132
+33.500000,33.500000,28.041531,33.500000,16.321011,33.500000,20.229132
+36.000000,36.000000,30.004779,36.000000,16.441081,36.000000,20.229132
+38.500000,38.500000,31.938310,38.500000,16.546466,38.500000,20.229132
+41.000000,41.000000,33.842793,41.000000,16.639705,41.000000,20.229132
+43.500000,43.500000,35.718878,43.500000,16.722784,43.500000,20.229132
+
+371Jeq2.csv,211,111,11,11,11,11,1,2,4.421958,4.421958,4.421958,.105119,-.058377,1,67.473965,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.140059,-9999.000000,-.135934,-9999.000000,4.421958
+371Jeq2.csv,211,111,11,11,11,11,1,2,5.736168,5.736168,5.736168,1.246974,.913300,1,66.335739,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.152567,-9999.000000,.641984,-9999.000000,5.736168
+371Jeq2.csv,211,111,11,11,11,11,1,2,7.407605,7.407605,7.407605,2.874199,2.111892,1,65.116266,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.167857,-9999.000000,1.756820,-9999.000000,7.407605
+371Jeq2.csv,211,111,11,11,11,11,1,2,9.077730,9.077730,9.077730,4.141766,3.268156,1,64.131875,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.181171,-9999.000000,2.637232,-9999.000000,9.077730
+371Jeq2.csv,211,111,11,11,11,11,1,2,10.054763,10.054763,10.054763,5.600013,3.918044,1,63.439818,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.189705,-9999.000000,3.634161,-9999.000000,10.054763
+371Jeq2.csv,211,111,11,11,11,11,1,2,11.410662,11.410662,11.410662,8.376207,4.805563,1,62.218312,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.200863,-9999.000000,5.536182,-9999.000000,11.410662
+371Jeq2.csv,211,111,11,11,11,11,1,2,15.457426,15.457426,15.457426,12.050142,7.302246,1,61.763647,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.232407,-9999.000000,8.095900,-9999.000000,15.457426
+371Jeq2.csv,211,111,11,11,11,11,1,2,18.453370,18.453370,18.453370,14.865519,9.021643,1,61.309216,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.254362,-9999.000000,10.055282,-9999.000000,18.453370
+371Jeq2.csv,211,111,11,11,11,11,1,2,22.087725,22.087725,22.087725,16.534050,10.978062,1,61.663498,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.279181,-9999.000000,11.232373,-9999.000000,22.087725
+371Jeq2.csv,211,111,11,11,11,11,1,2,24.614529,24.614529,24.614529,17.634794,12.111260,2,63.063877,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.292438,-9999.000000,12.005077,-9999.000000,24.614529
+371Jeq2.csv,211,111,11,11,11,11,1,2,26.640135,26.640135,26.640135,18.362624,12.574362,2,64.527546,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.293355,-9999.000000,12.518145,-9999.000000,26.640135
+371Jeq2.csv,211,111,11,11,11,11,1,2,31.772055,31.772055,31.772055,19.571966,13.601689,2,66.950602,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.296726,-9999.000000,13.374366,-9999.000000,31.772055
+371Jeq2.csv,211,111,11,11,11,11,1,2,32.865828,32.865828,32.865828,19.783484,13.700232,2,63.736675,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.294707,-9999.000000,13.528272,-9999.000000,32.865828
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,1.000000,-2.805379,1.000000,-7.004703,-9999.000000,-9999.000000
+2.000000,2.000000,-1.990940,2.000000,-4.413457,-9999.000000,-9999.000000
+3.000000,3.000000,-1.196248,3.000000,-2.284991,-9999.000000,-9999.000000
+4.000000,4.000000,-.420593,4.000000,-.505494,-9999.000000,-9999.000000
+5.000000,5.000000,.336699,5.000000,1.004354,5.000000,20.229132
+6.000000,6.000000,1.076275,6.000000,2.301526,6.000000,20.229132
+8.500000,8.500000,2.851665,8.500000,4.864743,8.500000,20.229132
+11.000000,11.000000,4.528952,11.000000,6.760408,11.000000,20.229132
+13.500000,13.500000,6.116050,13.500000,8.219255,13.500000,20.229132
+16.000000,16.000000,7.620042,16.000000,9.376670,16.000000,20.229132
+18.500000,18.500000,9.047289,18.500000,10.317329,18.500000,20.229132
+21.000000,21.000000,10.403520,21.000000,11.096909,21.000000,20.229132
+23.500000,23.500000,11.693905,23.500000,11.753522,23.500000,20.229132
+26.000000,26.000000,12.923126,26.000000,12.314134,26.000000,20.229132
+28.500000,28.500000,14.095433,28.500000,12.798366,28.500000,20.229132
+31.000000,31.000000,15.214687,31.000000,13.220831,31.000000,20.229132
+33.500000,33.500000,16.284411,33.500000,13.592640,33.500000,20.229132
+36.000000,36.000000,17.307821,36.000000,13.922387,36.000000,20.229132
+38.500000,38.500000,18.287861,38.500000,14.216828,38.500000,20.229132
+41.000000,41.000000,19.227231,41.000000,14.481346,41.000000,20.229132
+43.500000,43.500000,20.128411,43.500000,14.720281,43.500000,20.229132
+
+371Jeq2.csv,211,111,21,21,11,11,1,2,4.421958,4.421958,.074642,.105119,3.453191,1,99.589627,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.104330,-9999.000000,3.448985,-9999.000000,.079937
+371Jeq2.csv,211,111,21,21,11,11,1,2,5.736168,5.736168,.092076,1.246974,4.504829,1,99.578348,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.122526,-9999.000000,4.499767,-9999.000000,.098418
+371Jeq2.csv,211,111,21,21,11,11,1,2,7.407605,7.407605,.114195,2.874199,5.837968,1,99.567358,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.145579,-9999.000000,5.833739,-9999.000000,.119479
+371Jeq2.csv,211,111,21,21,11,11,1,2,9.077730,9.077730,.136141,4.141766,7.159006,1,99.559779,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.167216,-9999.000000,7.087465,-9999.000000,.225495
+371Jeq2.csv,211,111,21,21,11,11,1,2,10.054763,10.054763,.149699,5.600013,7.968240,1,99.552915,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.181229,-9999.000000,7.955924,-9999.000000,.165009
+371Jeq2.csv,211,111,21,21,11,11,1,2,11.410662,11.410662,.167735,8.376207,9.048485,1,99.541260,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.199777,-9999.000000,9.101149,-9999.000000,.102300
+371Jeq2.csv,211,111,21,21,11,11,1,2,15.457426,15.457426,.222529,12.050142,12.310654,1,99.546028,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.255774,-9999.000000,12.313652,-9999.000000,.218820
+371Jeq2.csv,211,111,21,21,11,11,1,2,18.453370,18.453370,.353015,14.865519,14.711336,2,99.385684,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.286752,-9999.000000,14.671751,-9999.000000,.401719
+371Jeq2.csv,211,111,21,21,11,11,1,2,22.087725,22.087725,2.284616,16.534050,16.149917,2,96.484300,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.287680,-9999.000000,16.037405,-9999.000000,2.422578
+371Jeq2.csv,211,111,21,21,11,11,1,2,24.614529,24.614529,4.669604,17.634794,16.406666,2,93.537842,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.289847,-9999.000000,16.412169,-9999.000000,4.662914
+371Jeq2.csv,211,111,21,21,11,11,1,2,26.640135,26.640135,6.657265,18.362624,16.493267,2,91.736264,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.290757,-9999.000000,16.568501,-9999.000000,6.566114
+371Jeq2.csv,211,111,21,21,11,11,1,2,31.772055,31.772055,11.782195,19.571966,16.715490,2,88.300379,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.294102,-9999.000000,16.587960,-9999.000000,11.934707
+371Jeq2.csv,211,111,21,21,11,11,1,2,32.865828,32.865828,12.844685,19.783484,16.613475,2,86.381229,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.292099,-9999.000000,16.555771,-9999.000000,12.914225
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,.031083,.786475,.015318,.799271,-9999.000000,-9999.000000
+2.000000,.044236,1.587503,.017538,1.609174,-9999.000000,-9999.000000
+3.000000,.057412,2.388513,.020014,2.418869,-9999.000000,-9999.000000
+4.000000,.070612,3.189503,.022795,3.228316,-9999.000000,-9999.000000
+5.000000,.083836,3.990474,.025941,4.037468,-9999.000000,-9999.000000
+6.000000,.097083,4.791427,.029526,4.846262,-9999.000000,-9999.000000
+8.500000,.130304,6.793723,.041150,6.866090,-9999.000000,-9999.000000
+11.000000,.163673,8.795899,.058999,8.880864,-9999.000000,-9999.000000
+13.500000,.197192,10.797953,.089792,10.885131,-9999.000000,-9999.000000
+16.000000,.230862,12.799885,.154723,12.861688,-9999.000000,-9999.000000
+18.500000,.264684,14.801694,.359678,14.724587,-9999.000000,-9999.000000
+21.000000,.298658,16.803380,1.392570,15.915446,-9999.000000,-9999.000000
+23.500000,.332785,18.804940,3.562032,16.183745,-9999.000000,-9999.000000
+26.000000,.367067,20.806375,5.975164,16.254256,1.078217,20.229132
+28.500000,.401505,22.807684,8.437591,16.284754,3.578217,20.229132
+31.000000,.436100,24.808865,10.916846,16.301593,6.078217,20.229132
+33.500000,.470852,26.809919,13.403733,16.312237,8.578217,20.229132
+36.000000,.505764,28.810843,15.894705,16.319565,11.078217,20.229132
+38.500000,.540835,30.811638,18.388114,16.324915,13.578217,20.229132
+41.000000,.576067,32.812302,20.883093,16.328990,16.078217,20.229132
+43.500000,.611461,34.812834,23.379141,16.332198,18.578217,20.229132
+
+371Jeq2.csv,221,111,11,11,11,11,1,2,4.421958,4.421958,4.421958,.105119,-.058376,1,67.473991,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.140059,-9999.000000,-.135934,-9999.000000,4.421958
+371Jeq2.csv,221,111,11,11,11,11,1,2,5.736168,5.736168,5.736168,1.246974,.913302,1,66.335766,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.152567,-9999.000000,.641985,-9999.000000,5.736168
+371Jeq2.csv,221,111,11,11,11,11,1,2,7.407605,7.407605,7.407605,2.874199,2.111895,1,65.116293,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.167857,-9999.000000,1.756823,-9999.000000,7.407605
+371Jeq2.csv,221,111,11,11,11,11,1,2,9.077730,9.077730,9.077730,4.141766,3.268160,1,64.131903,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.181171,-9999.000000,2.637235,-9999.000000,9.077730
+371Jeq2.csv,221,111,11,11,11,11,1,2,10.054763,10.054763,10.054763,5.600013,3.918049,1,63.439846,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.189705,-9999.000000,3.634166,-9999.000000,10.054763
+371Jeq2.csv,221,111,11,11,11,11,1,2,11.410662,11.410662,11.410662,8.376207,4.805570,1,62.218341,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.200863,-9999.000000,5.536189,-9999.000000,11.410662
+371Jeq2.csv,221,111,11,11,11,11,1,2,15.457426,15.457426,15.457426,12.050142,7.302256,1,61.763676,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.232407,-9999.000000,8.095910,-9999.000000,15.457426
+371Jeq2.csv,221,111,11,11,11,11,1,2,18.453370,18.453370,18.453370,14.865519,9.021654,1,61.309245,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.254362,-9999.000000,10.055294,-9999.000000,18.453370
+371Jeq2.csv,221,111,11,11,11,11,1,2,22.087725,22.087725,22.087725,16.534050,10.978076,1,61.663526,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.279181,-9999.000000,11.232386,-9999.000000,22.087725
+371Jeq2.csv,221,111,11,11,11,11,1,2,24.614529,24.614529,24.614529,17.634794,12.111275,2,63.063904,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.292438,-9999.000000,12.005092,-9999.000000,24.614529
+371Jeq2.csv,221,111,11,11,11,11,1,2,26.640135,26.640135,26.640135,18.362624,12.574377,2,64.527573,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.293355,-9999.000000,12.518160,-9999.000000,26.640135
+371Jeq2.csv,221,111,11,11,11,11,1,2,31.772055,31.772055,31.772055,19.571966,13.601705,2,66.950628,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.296726,-9999.000000,13.374383,-9999.000000,31.772055
+371Jeq2.csv,221,111,11,11,11,11,1,2,32.865828,32.865828,32.865828,19.783484,13.700249,2,63.736703,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.294707,-9999.000000,13.528288,-9999.000000,32.865828
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,1.000000,-2.805382,1.000000,-7.004710,-9999.000000,-9999.000000
+2.000000,2.000000,-1.990942,2.000000,-4.413462,-9999.000000,-9999.000000
+3.000000,3.000000,-1.196249,3.000000,-2.284993,-9999.000000,-9999.000000
+4.000000,4.000000,-.420594,4.000000,-.505494,-9999.000000,-9999.000000
+5.000000,5.000000,.336700,5.000000,1.004355,5.000000,20.229132
+6.000000,6.000000,1.076276,6.000000,2.301529,6.000000,20.229132
+8.500000,8.500000,2.851669,8.500000,4.864749,8.500000,20.229132
+11.000000,11.000000,4.528958,11.000000,6.760416,11.000000,20.229132
+13.500000,13.500000,6.116058,13.500000,8.219265,13.500000,20.229132
+16.000000,16.000000,7.620052,16.000000,9.376682,16.000000,20.229132
+18.500000,18.500000,9.047301,18.500000,10.317342,18.500000,20.229132
+21.000000,21.000000,10.403533,21.000000,11.096923,21.000000,20.229132
+23.500000,23.500000,11.693919,23.500000,11.753536,23.500000,20.229132
+26.000000,26.000000,12.923143,26.000000,12.314149,26.000000,20.229132
+28.500000,28.500000,14.095450,28.500000,12.798381,28.500000,20.229132
+31.000000,31.000000,15.214706,31.000000,13.220847,31.000000,20.229132
+33.500000,33.500000,16.284431,33.500000,13.592656,33.500000,20.229132
+36.000000,36.000000,17.307842,36.000000,13.922404,36.000000,20.229132
+38.500000,38.500000,18.287883,38.500000,14.216845,38.500000,20.229132
+41.000000,41.000000,19.227254,41.000000,14.481363,41.000000,20.229132
+43.500000,43.500000,20.128436,43.500000,14.720299,43.500000,20.229132
+
+371Jeq2.csv,221,111,21,21,11,11,1,2,4.421958,4.421958,.061129,.105119,2.106991,1,69.667597,4.722503,21.000000,1.828766,93.765701,1.807719,748.483948,27.440737,25.466099,1.081012,.055061,.101154,.103314,-9999.000000,2.168681,-9999.000000,.064314
+371Jeq2.csv,221,111,21,21,11,11,1,2,5.736168,5.736168,.079796,1.246974,3.235032,1,69.010910,9.284744,21.000000,1.845018,93.765121,1.806665,748.320129,27.514334,25.483648,1.119264,.057056,.119516,.121937,-9999.000000,3.302773,-9999.000000,.084448
+371Jeq2.csv,221,111,21,21,11,11,1,2,7.407605,7.407605,.103522,2.874199,4.667798,1,68.329731,13.930698,21.000000,1.857056,93.762604,1.803655,747.859192,27.558392,25.507936,1.156236,.059055,.143549,.145545,-9999.000000,4.722237,-9999.000000,.108406
+371Jeq2.csv,221,111,21,21,11,11,1,2,9.077730,9.077730,.127099,4.141766,6.089827,1,67.819306,18.532444,21.000000,1.869883,93.758751,1.791117,752.656982,27.562168,25.515574,1.175483,.060470,.149493,.167738,-9999.000000,6.538379,-9999.000000,.212417
+371Jeq2.csv,221,111,21,21,11,11,1,2,10.054763,10.054763,.141611,5.600013,6.956828,1,67.499872,23.133677,21.000000,1.886242,93.758102,1.789927,752.307434,27.635267,25.542072,1.197481,.061646,.177062,.182075,-9999.000000,7.087080,-9999.000000,.159466
+371Jeq2.csv,221,111,21,21,11,11,1,2,11.410662,11.410662,.160992,8.376207,8.119417,1,66.688585,36.968568,21.000000,1.902891,93.756218,1.774054,751.998169,27.642038,25.558516,1.231317,.063979,.229373,.201077,-9999.000000,7.335549,-9999.000000,.097864
+371Jeq2.csv,221,111,21,21,11,11,1,2,15.457426,15.457426,.219858,12.050142,11.627775,1,67.306076,50.764352,21.000000,1.920236,93.760933,1.769423,751.566040,27.703815,25.577255,1.199540,.062463,.256533,.258436,-9999.000000,11.673508,-9999.000000,.229415
+371Jeq2.csv,221,111,21,21,11,11,1,2,18.453370,18.453370,.393270,14.865519,14.595753,2,67.513450,64.606537,21.000000,1.936348,93.764381,1.772160,751.500244,27.793242,25.598539,1.188842,.061792,.282432,.286217,-9999.000000,14.648679,-9999.000000,.441160
+371Jeq2.csv,221,111,21,21,11,11,1,2,22.087725,22.087725,2.429051,16.534050,16.754513,2,66.606703,78.529723,21.000000,1.941673,93.765282,1.778054,751.203430,27.845459,25.617878,1.134871,.058748,.285451,.287144,-9999.000000,16.671636,-9999.000000,2.531320
+371Jeq2.csv,221,111,21,21,11,11,1,2,24.614529,24.614529,4.814654,17.634794,17.099773,2,66.655219,92.506767,21.000000,1.946412,93.768608,1.802464,751.009888,27.978724,25.633127,1.047879,.053442,.289946,.289307,-9999.000000,17.136238,-9999.000000,4.772492
+371Jeq2.csv,221,111,21,21,11,11,1,2,26.640135,26.640135,6.800288,18.362624,17.215581,2,67.693060,111.245730,21.000000,1.951034,93.768127,1.809146,750.768982,28.030703,25.651936,.933403,.047362,.292079,.290216,-9999.000000,17.325240,-9999.000000,6.675248
+371Jeq2.csv,221,111,21,21,11,11,1,2,31.772055,31.772055,11.921317,19.571966,17.475415,2,69.261094,148.710005,21.000000,1.966181,93.772064,1.838296,750.370056,28.232525,25.692453,.751472,.037435,.291893,.293555,-9999.000000,17.375343,-9999.000000,12.033064
+371Jeq2.csv,221,111,21,21,11,11,1,2,32.865828,32.865828,12.983979,19.783484,17.371967,2,65.992155,130.008366,21.000000,1.954853,93.769012,1.823533,750.677429,28.113436,25.661491,.830709,.041764,.291100,.291555,-9999.000000,17.344552,-9999.000000,13.014810
+CO2i,CO2cc,Ac,CO2cj,Aj,CO2ct,At
+1.000000,.014094,-.782969,.002231,-7.779976,-9999.000000,-9999.000000
+2.000000,.028214,.079421,.004709,-6.473019,-9999.000000,-9999.000000
+3.000000,.042361,.941788,.007476,-5.166441,-9999.000000,-9999.000000
+4.000000,.056536,1.804132,.010587,-3.860313,-9999.000000,-9999.000000
+5.000000,.070737,2.666451,.014108,-2.554723,-9999.000000,-9999.000000
+6.000000,.084966,3.528747,.018128,-1.249785,-9999.000000,-9999.000000
+8.500000,.120656,5.684382,.031190,2.008609,-9999.000000,-9999.000000
+11.000000,.156519,7.839868,.051349,5.257706,-9999.000000,-9999.000000
+13.500000,.192554,9.995202,.086388,8.487307,-9999.000000,-9999.000000
+16.000000,.228763,12.150384,.161197,11.664800,-9999.000000,-9999.000000
+18.500000,.265147,14.305413,.401097,14.625992,-9999.000000,-9999.000000
+21.000000,.301708,16.460287,1.524948,16.429027,-9999.000000,-9999.000000
+23.500000,.338447,18.615006,3.708712,16.843360,-9999.000000,-9999.000000
+26.000000,.375364,20.769568,6.119897,16.959726,2.217923,20.229132
+28.500000,.412462,22.923973,8.580469,17.011385,4.842059,20.229132
+31.000000,.449742,25.078218,11.058427,17.040265,7.377878,20.229132
+33.500000,.487204,27.232304,13.544392,17.058653,9.895239,20.229132
+36.000000,.524851,29.386229,16.034685,17.071372,12.405523,20.229132
+38.500000,.562683,31.539991,18.527575,17.080687,14.912332,20.229132
+41.000000,.600702,33.693589,21.022145,17.087802,17.417176,20.229132
+43.500000,.638910,35.847023,23.517863,17.093412,19.920799,20.229132
+
diff --git a/Core/Charter/CurveDataConverter.cs b/Core/Charter/CurveDataConverter.cs
index 03bd375..0358560 100644
--- a/Core/Charter/CurveDataConverter.cs
+++ b/Core/Charter/CurveDataConverter.cs
@@ -8,7 +8,7 @@ namespace LeafWeb.Core.Charter
{
public static class CurveDataConverter
{
- public static IEnumerable Convert(IEnumerable cntrlComparison)
+ public static IEnumerable Convert(IEnumerable cntrlComparison)
{
var comparisonGroups =
from comparison in cntrlComparison
@@ -17,12 +17,12 @@ namespace LeafWeb.Core.Charter
{
CurveID = curves.Key,
FitType = from curve in curves
- group curve by new {curve.FitGi, curve.FitGammaStar} into grp
+ group curve by new {curve.FitRwp, curve.FitGammaStar} into grp
select new
{
- grp.Key.FitGi,
+ grp.Key.FitRwp,
grp.Key.FitGammaStar,
- Comparison = grp.SingleOrDefault()
+ Comparison = grp.FirstOrDefault() // TODO: this may need to be SingleOrDefault
}
};
@@ -44,13 +44,13 @@ namespace LeafWeb.Core.Charter
// gammastar = chloroplastic CO2 partial pressure photocompensation point = "Cmp"
// put each comparison into the correct curve location
- if (!fitType.FitGi && !fitType.FitGammaStar)
+ if (!fitType.FitRwp && !fitType.FitGammaStar)
curveData.FixedCndFixedCmp = paramSet;
- else if (!fitType.FitGi && fitType.FitGammaStar)
+ else if (!fitType.FitRwp && fitType.FitGammaStar)
curveData.FixedCndEstimatedCmp = paramSet;
- else if (fitType.FitGi && !fitType.FitGammaStar)
+ else if (fitType.FitRwp && !fitType.FitGammaStar)
curveData.EstimatedCndFixedCmp = paramSet;
- else if (fitType.FitGi && fitType.FitGammaStar)
+ else if (fitType.FitRwp && fitType.FitGammaStar)
curveData.EstimatedCndEstimatedCmp = paramSet;
}
@@ -71,7 +71,7 @@ namespace LeafWeb.Core.Charter
}
}
- private static CurveParamSet ConvertParamSet(CntrlComparison comparison)
+ private static CurveParamSet ConvertParamSet(LeafGasComparison comparison)
{
var curveParamSet = new CurveParamSet();
foreach (var fittingInfo in comparison.FittingInfo)
@@ -85,7 +85,7 @@ namespace LeafWeb.Core.Charter
return curveParamSet;
}
- private static void Set(CurveParamSet paramSet, CntrlComparisonPhotosyntheticInfo item)
+ private static void Set(CurveParamSet paramSet, LeafGasComparisonPhotosyntheticInfo item)
{
AddXyIfInRange(item.CO2cc, item.Ac, paramSet.AcChloroData.Add); // Ac(y),CO2cc(x)
AddXyIfInRange(item.CO2cj, item.Aj, paramSet.AjChloroData.Add); // Aj(y),CO2cj(x)
@@ -103,12 +103,12 @@ namespace LeafWeb.Core.Charter
set(xyPoint);
}
- private static void Set(CurveParamSet paramSet, CntrlComparisonFittingInfo fittingInfo)
+ private static void Set(CurveParamSet paramSet, LeafGasComparisonFittingInfo fittingInfo)
{
- var xyPoint1 = new XyPoint(fittingInfo.PCO2c, fittingInfo.AnetMeas); // AnetMeas(y), PCO2c(x)
- var xyPoint2 = new XyPoint(fittingInfo.PCO2i, fittingInfo.AnetMeas);
+ var xyPoint1 = new XyPoint(fittingInfo.CO2c, fittingInfo.Anet_obs); // AnetMeas(y), PCO2c(x)
+ var xyPoint2 = new XyPoint(fittingInfo.CO2i_obs, fittingInfo.Anet_obs);
- switch (fittingInfo.PointLimitType)
+ switch (fittingInfo.LimitState)
{
case 1:
paramSet.AnetMeasChloro1Data.Add(xyPoint1);
diff --git a/Core/Core.csproj b/Core/Core.csproj
index 5049f03..a72b4c4 100644
--- a/Core/Core.csproj
+++ b/Core/Core.csproj
@@ -76,13 +76,14 @@
+
+
+
+
-
-
-
@@ -100,7 +101,6 @@
-
diff --git a/Core/Entities/CntrlComparison.cs b/Core/Entities/CntrlComparison.cs
deleted file mode 100644
index 67079c9..0000000
--- a/Core/Entities/CntrlComparison.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using System.Linq;
-
-namespace LeafWeb.Core.Entities
-{
- ///
- /// Part of LeafOutput
- /// The file 'cntrlcomparison.csv', which is in comma-separated-value format, contains outputs from PISCAL that
- /// facilitates examination of how well the fitting is.
- ///
- public class CntrlComparison
- {
- public virtual IEnumerable FittingInfo { get; set; }
- public virtual IEnumerable PhotosyntheticInfo { get; set; }
-
- public string CurveID => FittingInfo.First().CurveID;
-
- public bool FitGi => FittingInfo.First().FitGi;
-
- public bool FitGammaStar => FittingInfo.First().FitGammaStar;
- }
-}
\ No newline at end of file
diff --git a/Core/Entities/CntrlComparisonFittingInfo.cs b/Core/Entities/CntrlComparisonFittingInfo.cs
deleted file mode 100644
index c065c6d..0000000
--- a/Core/Entities/CntrlComparisonFittingInfo.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using LeafWeb.Core.Utility;
-
-namespace LeafWeb.Core.Entities
-{
- ///
- /// First model prediction is calculated at each sampling point.
- /// Then model prediction is calculated at many selected levels of intercelluar CO2 partial pressure
- /// levels under three limitation states to enable plotting curves.The same structure is then repeated for
- /// each fitting of the same curve with different parameters to be estimated and with different curves. Note
- /// that some common information about a curve is repeated for each data point to make the structure of the
- /// file as regular as possible.
- ///
- public class CntrlComparisonFittingInfo
- {
- ///
- /// the curve identifier, repeated for each point
- ///
- [ParseInfo(1)]
- public string CurveID { get; set; }
-
- ///
- /// whether or not chlorophyll fluorescence data are used for identifying the limitation states
- /// 0 = not used, 1 = used. (Currently this choice is still under evaluation and therefore ChlFlUse? = 0).
- ///
- [ParseInfo(2, alternateTitle: "ChlFlUse?")]
- public bool ChlFlUse {get; set; }
-
- ///
- /// whether or not the internal conductance (gi) is fitted for.
- /// 0 = not fitted and gi is either infinite or fixed at the value provided by the user.
- /// 1 = gi is estiamted, repeated for each point
- ///
- [ParseInfo(3, alternateTitle: "FitGi?")]
- public bool FitGi {get; set;}
-
- ///
- /// whether or not the chloroplastic CO2 partial pressure photocompensation point is
- /// fitted for. 0= not fitted, a prescribed value is used, repeated for each point
- ///
- [ParseInfo(4, alternateTitle: "FitGamma*?")]
- public bool FitGammaStar {get; set; }
-
- ///
- /// whether or not the apparent Michaelis - Menten constant Kco = Kc(1+O/Ko) is fitted for.
- /// 0= not fitted, a prescribed value is calculated from Kc, Ko and the oxygen partial pressure.
- /// 1= Fitted for, repeated for each point
- ///
- [ParseInfo(5, alternateTitle: "FitKco?")]
- public bool FitKco {get; set; }
-
- ///
- /// whether the dark respiration is fitted for. 0= not fitted for, a prescribed value is used.
- /// 1= fitted for. repeated for each point
- ///
- [ParseInfo(6, alternateTitle: "FitRd?")]
- public bool FitRd {get; set;}
-
- ///
- /// whether alpha (the non-returned fraction of the glycolate carbon
- /// recycled in the photorespiratory cycle) is fitted for.
- /// 0= not fitted for and alpha = 0
- /// 1= fitted for, repeated for each point
- ///
- [ParseInfo(7, alternateTitle: "FitAlpha?")]
- public bool FitAlpha {get; set;}
-
- ///
- /// the combination of limitation states present in the A/Ci dataset. Parameters
- /// are estimated for those limitation states that occur in the measured curve, repeated for each point
- /// Rubisco: Rubisco limitation(Vcmax, Kco)
- /// RuBP: RuBP regeneration limitation(J)
- /// Tpu: export limitation(TPU, alpha)
- ///
- [ParseInfo(8)]
- public string LimitCombina { get; set; }
-
- ///
- /// intercellular CO2 partial pressure
- ///
- [ParseInfo(9, units:"Pa")]
- public double PCO2i { get; set; }
-
- ///
- /// chloroplastic CO2 partial pressure corresponding to the PCO2i of a point.
- /// PCO2c=PCO2i-AnetCal/internal conductance
- ///
- [ParseInfo(10, units:"Pa")]
- public double PCO2c { get; set; }
-
- ///
- /// measured net assimilation rate
- ///
- [ParseInfo(11, units: "umol/m2/s")]
- public double AnetMeas { get; set; }
-
- ///
- /// calculated net assimilation rate
- ///
- [ParseInfo(12, units: "umol/m2/s")]
- public double AnetCal { get; set; }
-
- // TODO: readme has weitedrms, data file has PCOiCal
- // weitedrms - (umol/m2/s), root mean square error of the fitting (weiting coefficient =1)
- [ParseInfo(13)]
- public double PCOiCal { get; set; }
-
- ///
- /// 1 = point limited by rubisco
- /// 2 = point limited by RuBP regeneration
- /// 3 = point limited by TPU
- ///
- [ParseInfo(14, units:"1,2,3")]
- public int PointLimitType { get; set; }
-
- public virtual CntrlComparison CntrlComparison { get; set; }
- }
-}
\ No newline at end of file
diff --git a/Core/Entities/LeafGasComparison.cs b/Core/Entities/LeafGasComparison.cs
new file mode 100644
index 0000000..0dbd99b
--- /dev/null
+++ b/Core/Entities/LeafGasComparison.cs
@@ -0,0 +1,22 @@
+using System.Collections.Generic;
+using System.Linq;
+
+namespace LeafWeb.Core.Entities
+{
+ ///
+ /// Part of LeafOutput
+ /// The file 'leafgascomparison.csv', which is in comma-separated-value format, contains outputs from PISCAL that
+ /// facilitates examination of how well the fitting is.
+ ///
+ public class LeafGasComparison
+ {
+ public virtual IEnumerable FittingInfo { get; set; }
+ public virtual IEnumerable PhotosyntheticInfo { get; set; }
+
+ public string CurveID => FittingInfo.First().CurveID;
+
+ public bool FitRwp => FittingInfo.First().FitRwp;
+
+ public bool FitGammaStar => FittingInfo.First().FitGammaStar;
+ }
+}
\ No newline at end of file
diff --git a/Core/Entities/LeafGasComparisonFittingInfo.cs b/Core/Entities/LeafGasComparisonFittingInfo.cs
new file mode 100644
index 0000000..9446904
--- /dev/null
+++ b/Core/Entities/LeafGasComparisonFittingInfo.cs
@@ -0,0 +1,65 @@
+using LeafWeb.Core.Utility;
+
+namespace LeafWeb.Core.Entities
+{
+ ///
+ /// First model prediction is calculated at each sampling point.
+ /// Then model prediction is calculated at many selected levels of intercelluar CO2 partial pressure
+ /// levels under three limitation states to enable plotting curves.The same structure is then repeated for
+ /// each fitting of the same curve with different parameters to be estimated and with different curves. Note
+ /// that some common information about a curve is repeated for each data point to make the structure of the
+ /// file as regular as possible.
+ ///
+ public class LeafGasComparisonFittingInfo
+ {
+ ///
+ /// the curve identifier, repeated for each point
+ ///
+ [ParseInfo(1)]
+ public string CurveID { get; set; }
+
+ ///
+ /// whether or not the internal conductance (gi) is fitted for.
+ /// 0 = not fitted and gi is either infinite or fixed at the value provided by the user.
+ /// 1 = gi is estiamted, repeated for each point
+ ///
+ [ParseInfo(2, boolEncodedPosition: 1, alternateTitle: "FitRwp|Rch|ha?")] // formerly FitGi
+ public bool FitRwp {get; set;}
+
+ ///
+ /// whether or not the chloroplastic CO2 partial pressure photocompensation point is
+ /// fitted for. 0= not fitted, a prescribed value is used, repeated for each point
+ ///
+ [ParseInfo(4, boolEncodedPosition: 1, alternateTitle: "FitGamma*?")]
+ public bool FitGammaStar {get; set; }
+
+ ///
+ /// intercellular CO2 partial pressure
+ ///
+ [ParseInfo(10, units:"Pa")]
+ public double CO2i_obs { get; set; }
+
+ ///
+ /// chloroplastic CO2 partial pressure corresponding to the PCO2i of a point.
+ /// PCO2c=PCO2i-AnetCal/internal conductance
+ ///
+ [ParseInfo(12, units:"Pa")]
+ public double CO2c { get; set; }
+
+ ///
+ /// measured net assimilation rate
+ ///
+ [ParseInfo(13, units: "umol/m2/s")]
+ public double Anet_obs { get; set; }
+
+ ///
+ /// 1 = point limited by rubisco
+ /// 2 = point limited by RuBP regeneration
+ /// 3 = point limited by TPU
+ ///
+ [ParseInfo(15, units:"1,2,3")]
+ public int LimitState { get; set; }
+
+ public virtual LeafGasComparison LeafGasComparison { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Core/Entities/CntrlComparisonPhotosyntheticInfo.cs b/Core/Entities/LeafGasComparisonPhotosyntheticInfo.cs
similarity index 93%
rename from Core/Entities/CntrlComparisonPhotosyntheticInfo.cs
rename to Core/Entities/LeafGasComparisonPhotosyntheticInfo.cs
index 3568bef..a91f66d 100644
--- a/Core/Entities/CntrlComparisonPhotosyntheticInfo.cs
+++ b/Core/Entities/LeafGasComparisonPhotosyntheticInfo.cs
@@ -6,7 +6,7 @@ namespace LeafWeb.Core.Entities
/// The second section gives photosynthesis for each of the three limitation states at selected values of intercellular
/// partial pressure.Note that the corresponding values of chloraplastic CO2 partial pressure depend on the limitation state.
///
- public class CntrlComparisonPhotosyntheticInfo
+ public class LeafGasComparisonPhotosyntheticInfo
{
///
/// intercellular CO2 partial pressure
@@ -50,6 +50,6 @@ namespace LeafWeb.Core.Entities
[ParseInfo(7, units: "umol/m2/s")]
public double At { get; set; }
- public virtual CntrlComparison CntrlComparison { get; set; }
+ public virtual LeafGasComparison LeafGasComparison { get; set; }
}
}
\ No newline at end of file
diff --git a/Core/Entities/LeafOutputFile.cs b/Core/Entities/LeafOutputFile.cs
index cd14c80..f2acb5f 100644
--- a/Core/Entities/LeafOutputFile.cs
+++ b/Core/Entities/LeafOutputFile.cs
@@ -12,7 +12,7 @@ namespace LeafWeb.Core.Entities
public byte[] Contents { get; set; }
// convention for the filename which LeafCharter uses
- public bool IsLeafChartFile => Filename?.StartsWith("cntrlcomparison") ?? false;
+ public bool IsLeafChartFile => Filename?.Contains("leafgascomparison") ?? false;
public bool IsErrorMessage => Filename?.Contains("errormessage") ?? false;
public bool IsWarningMessage => Filename?.Contains("warningmessage") ?? false;
}
diff --git a/Core/Parsers/CntrlComparisonParser.cs b/Core/Parsers/LeafGasComparisonParser.cs
similarity index 71%
rename from Core/Parsers/CntrlComparisonParser.cs
rename to Core/Parsers/LeafGasComparisonParser.cs
index 6e0c8d7..72ee7c0 100644
--- a/Core/Parsers/CntrlComparisonParser.cs
+++ b/Core/Parsers/LeafGasComparisonParser.cs
@@ -6,17 +6,17 @@ using LeafWeb.Core.Utility;
namespace LeafWeb.Core.Parsers
{
- public class CntrlComparisonParser : CsvParserBase
+ public class LeafGasComparisonParser : CsvParserBase
{
- public CntrlComparisonParser(FileSystemInfo csvFile) : base(csvFile)
+ public LeafGasComparisonParser(FileSystemInfo csvFile) : base(csvFile)
{
}
- public CntrlComparisonParser(byte[] fileContents) : base(fileContents)
+ public LeafGasComparisonParser(byte[] fileContents) : base(fileContents)
{
}
- public CntrlComparison[] Parse()
+ public LeafGasComparison[] Parse()
{
var fittingTitles = GetNextCsvRowValues();
if (fittingTitles == null)
@@ -25,10 +25,10 @@ namespace LeafWeb.Core.Parsers
if (fitUnits == null)
throw new ParseException($"Could not read data units row on line number {CsvReader.Row}");
- return ParseCntrlComparisonSet(fittingTitles).ToArray();
+ return ParseLeafGasComparisonSet(fittingTitles).ToArray();
}
- private IEnumerable ParseCntrlComparisonSet(string[] fittingTitles)
+ private IEnumerable ParseLeafGasComparisonSet(string[] fittingTitles)
{
var endOfFile = false;
while (!endOfFile)
@@ -43,7 +43,7 @@ namespace LeafWeb.Core.Parsers
throw new ParseException($"Encountered empty line while readding fitting info on line {CsvReader.Row}");
if (values == null) // end of file
yield break;
- if (ParsedObjectFactory.IsPropertiesTitlesMatch(values))
+ if (ParsedObjectFactory.IsPropertiesTitlesMatch(values))
{
photosyntheticTitles = values;
break;
@@ -66,13 +66,13 @@ namespace LeafWeb.Core.Parsers
}
var fittingInfo =
- ParsedObjectFactory
+ ParsedObjectFactory
.Create(fittingTitles, fittingValues.ToArray());
var photosyntheticInfo =
- ParsedObjectFactory
+ ParsedObjectFactory
.Create(photosyntheticTitles, photosyntheticValues.ToArray());
- yield return new CntrlComparison
+ yield return new LeafGasComparison
{
FittingInfo = fittingInfo,
PhotosyntheticInfo = photosyntheticInfo
diff --git a/Core/Utility/BoolTypeConverter.cs b/Core/Utility/BoolTypeConverter.cs
index eccfe67..862eee6 100644
--- a/Core/Utility/BoolTypeConverter.cs
+++ b/Core/Utility/BoolTypeConverter.cs
@@ -24,6 +24,8 @@ namespace LeafWeb.Core.Utility
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
{
+ if (value is bool)
+ return value;
if (value is string)
{
var s = value as string;
diff --git a/Core/Utility/ParseInfoAttribute.cs b/Core/Utility/ParseInfoAttribute.cs
index a313a6b..05dcf36 100644
--- a/Core/Utility/ParseInfoAttribute.cs
+++ b/Core/Utility/ParseInfoAttribute.cs
@@ -8,6 +8,7 @@ namespace LeafWeb.Core.Utility
public class ParseInfoAttribute : Attribute
{
public int Position { get; private set; }
+ public int? BoolEncodedPosition { get; private set; }
public string Units { get; private set; }
public string Title { get; private set; }
public string AlterateTitle { get; private set; }
@@ -23,13 +24,16 @@ namespace LeafWeb.Core.Utility
}
}
- public ParseInfoAttribute(int position, [CallerMemberName]string title = null, string units = null, string alternateTitle = null, string exampleValue = null)
+ public ParseInfoAttribute(int position, [CallerMemberName]string title = null,
+ string units = null, string alternateTitle = null, string exampleValue = null,
+ int boolEncodedPosition = -1)
{
AlterateTitle = alternateTitle;
ExampleValue = exampleValue;
Title = title;
Position = position;
Units = units;
+ BoolEncodedPosition = boolEncodedPosition == -1 ? (int?)null : boolEncodedPosition;
}
public bool IsTitleMatch(string title)
diff --git a/Core/Utility/ParsedObjectFactory.cs b/Core/Utility/ParsedObjectFactory.cs
index a08e11e..4085e9d 100644
--- a/Core/Utility/ParsedObjectFactory.cs
+++ b/Core/Utility/ParsedObjectFactory.cs
@@ -132,6 +132,7 @@ namespace LeafWeb.Core.Utility
return string.IsNullOrEmpty(value) || value == "NA" || value == "-9999";
}
+ // TODO: this call maybe could be cached
private static PropertyInfo MatchProperty(PropertyInfo[] properties, string title, int position)
{
return
@@ -139,6 +140,7 @@ namespace LeafWeb.Core.Utility
properties.FirstOrDefault(p => p.Attribute().IsPositionMatch(position));
}
+ // TODO: this call maybe could be cached
private static PropertyInfo MatchPropertyExact(PropertyInfo[] properties, string title, int position)
{
return
@@ -180,6 +182,7 @@ namespace LeafWeb.Core.Utility
{
// http://stackoverflow.com/questions/3531318/convert-changetype-fails-on-nullable-types
var t = Nullable.GetUnderlyingType(property.PropertyType) ?? property.PropertyType;
+ value = HandleBoolEncodedProperty(property, value);
// convertedValue = Convert.ChangeType(value, t);
var converter = TypeDescriptor.GetConverter(t);
convertedValue = converter.ConvertTo(value, t);
@@ -191,5 +194,26 @@ namespace LeafWeb.Core.Utility
}
return true;
}
+
+ private static object HandleBoolEncodedProperty(PropertyInfo property, object value)
+ {
+ var boolEncodedPosition = property.Attribute().BoolEncodedPosition;
+ if (boolEncodedPosition == null) return value;
+
+ var v = (value as string)?.Substring(boolEncodedPosition.Value -1, 1);
+ switch (v)
+ {
+ // these values are False=1, True=2
+ case "1":
+ value = false;
+ break;
+ case "2":
+ value = true;
+ break;
+ default:
+ throw new ArgumentOutOfRangeException($"{property.Name} {boolEncodedPosition} {value} {v}");
+ }
+ return value;
+ }
}
}
\ No newline at end of file
diff --git a/Web/Controllers/LeafCharterController.cs b/Web/Controllers/LeafCharterController.cs
index ca6169f..b61a98d 100644
--- a/Web/Controllers/LeafCharterController.cs
+++ b/Web/Controllers/LeafCharterController.cs
@@ -34,20 +34,20 @@ namespace LeafWeb.Web.Controllers
.FirstOrDefault(f => f.IsLeafChartFile);
if (leafOutputFile == null)
- return View(); // TODO: break
+ throw new ArgumentOutOfRangeException(); // TODO: break
return File(GetChartImage(leafOutputFile.Contents, number), "image/png", "mychart.png");
}
private byte[] GetChartImage(byte[] fileContents, int number, ChartImageFormat format = ChartImageFormat.Png)
{
- CntrlComparison[] cntrlComparison;
- using (var parser = new CntrlComparisonParser(fileContents))
- cntrlComparison = parser.Parse();
+ LeafGasComparison[] leafGasComparisons;
+ using (var parser = new LeafGasComparisonParser(fileContents))
+ leafGasComparisons = parser.Parse();
- var curveData = CurveDataConverter.Convert(cntrlComparison).ToArray();
+ var curveData = CurveDataConverter.Convert(leafGasComparisons).ToArray();
- var charts = LeafWebCharter.ProduceCharts(curveData[2]);
+ var charts = LeafWebCharter.ProduceCharts(curveData[0]);
//Image.FromFile()
diff --git a/Web/ViewModels/ResultStatus/ResultStatusViewModel.cs b/Web/ViewModels/ResultStatus/ResultStatusViewModel.cs
index 67ff284..f84e30b 100644
--- a/Web/ViewModels/ResultStatus/ResultStatusViewModel.cs
+++ b/Web/ViewModels/ResultStatus/ResultStatusViewModel.cs
@@ -13,6 +13,7 @@ namespace LeafWeb.Web.ViewModels.ResultStatus
public string LeafInputIdentifier { get; set; }
public string LeafInputSiteId { get; set; }
public string LeafInputPhotosynthesisType { get; set; }
+ public bool HasLeafChart { get; set; }
public string CurrentStatus { get; set; }
public string[] ErrorMessages { get; set; }
//public string[] LeafOutputFilenames { get; set; }
@@ -25,6 +26,7 @@ namespace LeafWeb.Web.ViewModels.ResultStatus
{
cfg.CreateMap()
.ForMember(dest => dest.LeafInputId, opt => opt.MapFrom(src => src.Id))
+ .ForMember(dest => dest.HasLeafChart, opt => opt.ResolveUsing(src => src.OutputFiles.Any(o => o.IsLeafChartFile)))
//.ForMember(dest => dest.LeafOutputFilenames,
// opt => opt.ResolveUsing(
// src =>
diff --git a/Web/Views/LeafCharter/Index.cshtml b/Web/Views/LeafCharter/Index.cshtml
index f3bc429..60fd503 100644
--- a/Web/Views/LeafCharter/Index.cshtml
+++ b/Web/Views/LeafCharter/Index.cshtml
@@ -3,5 +3,5 @@
@for (int i = 0; i < 8; i++)
{
-
+
}
\ No newline at end of file
diff --git a/Web/Views/ResultStatus/Index.cshtml b/Web/Views/ResultStatus/Index.cshtml
index 2640d3d..4c70745 100644
--- a/Web/Views/ResultStatus/Index.cshtml
+++ b/Web/Views/ResultStatus/Index.cshtml
@@ -12,7 +12,11 @@
grid.Column("LeafInputIdentifier", "Identifier"),
grid.Column("LeafInputSiteId", "Site Id"),
grid.Column("LeafInputName", "Submitted By"),
- grid.Column("CurrentStatus", "Status")
- ),
+ grid.Column("CurrentStatus", "Status"),
+ grid.Column("Chart", "Chart", item =>
+ item.HasLeafChart
+ ? Html.ActionLink("Chart", "Index", "LeafCharter", new {leafInputId = item.LeafInputId}, new {})
+ : Html.Raw(""))
+ ),
htmlAttributes: new { @class = "table table-striped table-bordered table-hover table-condensed" }
)