From e6ad04cf2bf91dcc4b3d6e47546e65530b78da2c Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Wed, 17 Feb 2016 11:11:25 -0500 Subject: [PATCH] Rearrange LeafInput data --- Core/Core.csproj | 7 +- Core/Entities/LeafInputData.cs | 165 ++++-------------- Core/Entities/LeafInputDataCurve.cs | 147 ++++++++++++++++ ...etic.cs => LeafInputDataPhotosynthetic.cs} | 4 +- ...{LeafInputSite.cs => LeafInputDataSite.cs} | 4 +- Core/Entities/LeafInputInfo.cs | 50 ------ Core/Entities/LeafOutputFile.cs | 14 ++ 7 files changed, 203 insertions(+), 188 deletions(-) create mode 100644 Core/Entities/LeafInputDataCurve.cs rename Core/Entities/{LeafInputPhotosynthetic.cs => LeafInputDataPhotosynthetic.cs} (92%) rename Core/Entities/{LeafInputSite.cs => LeafInputDataSite.cs} (97%) delete mode 100644 Core/Entities/LeafInputInfo.cs create mode 100644 Core/Entities/LeafOutputFile.cs diff --git a/Core/Core.csproj b/Core/Core.csproj index a6675d6..300864d 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -71,6 +71,7 @@ + @@ -78,11 +79,11 @@ - + - - + + diff --git a/Core/Entities/LeafInputData.cs b/Core/Entities/LeafInputData.cs index d5b3d9f..338b7e1 100644 --- a/Core/Entities/LeafInputData.cs +++ b/Core/Entities/LeafInputData.cs @@ -1,147 +1,50 @@ -using System.ComponentModel.DataAnnotations; +using System.Collections.Generic; using LeafWeb.Core.Utility; namespace LeafWeb.Core.Entities { - /// - /// A/Ci data for a variety of analyses, including photosynthesis, stomatal conductance, internal conductance, water use efficiency. - /// - public class LeafInputData - { + /// + /// Descriptive information about the investigator, + /// contact information, the site,the sample leaf and its general environmental condition + /// + public class LeafInputData + { public int Id { get; set; } - public virtual LeafInputInfo LeafInputInfo { get; set; } + public virtual LeafInputDataSite Site { get; set; } + public virtual LeafInputDataPhotosynthetic Photosynthetic { get; set; } + public virtual ICollection Data { get; set; } - public int ListOrder { get; set; } + [ParseInfo(1, exampleValue: "First and last name")] + public string InvestigatorName { get; set; } - /// the data point No. - [ParseInfo(1, units: "no unit")] - public double? Obs { get; set; } + [ParseInfo(2, exampleValue: "Your email / mail addresses")] + public string ContactInformation { get; set; } - /// clock time - [StringLength(8)] - [ParseInfo(2, units: "hh:mm:ss")] - public string HHMMSS { get; set; } + [ParseInfo(3, alternateTitle: "Site name in full", exampleValue: "Your site's identifier / name")] + public string SiteName { get; set; } - /// number of seconds since file opened - [ParseInfo(3, units: "seconds")] - public double? FTime { get; set; } + [ParseInfo(4, exampleValue: "Mixed forest / grasslands / croplands/ etc")] + public string VegetationType { get; set; } - /// photosynthetic rate - [ParseInfo(4, units: "umol/m2/s")] - public double? Photo { get; set; } + [ParseInfo(5, exampleValue: "Soil type at your site")] + public string SoilType { get; set; } - /// adjusted photosynthetic rate (leakage corrected) - /// required - [ParseInfo(5, alternateTitle: "!AdjPhoto", units: "umol/m2/s")] - public double? AdjPhoto { get; set; } + [ParseInfo(6, exampleValue: "List of major species at the site")] + public string MajorSpecies { get; set; } - /// stomatal conductance - /// required - [ParseInfo(6, alternateTitle: "!StomCond", units: "mol/m2/s")] - public double? StomCond { get; set; } + [ParseInfo(7, + alternateTitle: "Sample leaf light environment", + exampleValue: "The general light environment in which the leaf is in (e.g. heavily shaded from above)")] + public string SampleLeafLightEnv { get; set; } - /// intercellular CO2 concentration (umol CO2 / mol moist air) - [ParseInfo(7, alternateTitle: "!Ci", units: "umol/mol")] - public double? Ci { get; set; } + [ParseInfo(8, exampleValue: "Indicate whether there is water stress at the time of sampling")] + public string WaterStressAssessment { get; set; } - /// transpiration rate - /// must provide - [ParseInfo(8, alternateTitle: "!Trmmol", units:"mmol/m2/s")] - public double? Trmmol { get; set; } + [ParseInfo(9, exampleValue: "For example - Licor-6400")] + public string InstrumentUsed { get; set; } - /// water vapor pressure deficit based on leaf temperature, must provide - [ParseInfo(9, alternateTitle: "!VpdL", units: "KPa")] - public double? VpdL { get; set; } - - /// leaf area - [ParseInfo(10, units:"cm2")] - public double? Area { get; set; } - - /// estimate of the ratio of stomatal conductances of one side of the leaf to the other - [ParseInfo(11, units: "NA")] - public double? StmRat { get; set; } - - /// total boundary layer conductance - [ParseInfo(12, units: "mol/m2/s")] - public double? BLCond { get; set; } - - /// temperature in sample cell - [ParseInfo(13, units: "oC")] - public double? Tair { get; set; } - - /// temperature of leaf thermocouple - /// required - [ParseInfo(14, alternateTitle: "!Tleaf", units: "oC")] - public double? Tleaf { get; set; } - - /// IRGA Block temperature - [ParseInfo(15, units: "oC")] - public double? TBlk { get; set; } - - /// reference CO2 concentration - [ParseInfo(16, units: "umol/mol")] - public double? CO2R { get; set; } - - /// Sample CO2 concentration - [ParseInfo(17, units: "umol/mol")] - public double? CO2S { get; set; } - - /// reference cell water vapor concentration - [ParseInfo(18, units: "mmol/mol")] - public double? H2OR { get; set; } - - /// sample cell water vapor concentration - [ParseInfo(19, units: "mmol/mol")] - public double? H2OS { get; set; } - - /// (%) Reference cell relative humidity - [ParseInfo(20)] - public double? RH_R { get; set; } - - /// (%) sample cell relative humidity - [ParseInfo(21)] - public double? RH_S { get; set; } - - /// (umol/s) molar flow rate of air entering the leaf chamber - [ParseInfo(22)] - public double? Flow { get; set; } - - /// PAR measured by the in-chamber quantum sensor - /// required - [ParseInfo(23, alternateTitle: "!PARi", units: "umol/m2/s")] - public double? PARi { get; set; } - - /// PAR measured by the external quantum sensor - [ParseInfo(24, units: "umol/m2/s")] - public double? PARo { get; set; } - - /// atmospheric pressure - [ParseInfo(25, units: "KPa")] - public double? Press { get; set; } - - /// sample CO2 offset - [ParseInfo(26, units: "umol/mol")] - public double? CsMch { get; set; } - - /// sample H2O offset - [ParseInfo(27, units: "mmol/mol")] - public double? HsMch { get; set; } - - /// a stability indicator as a decimal value - [ParseInfo(28, units: "NA")] - public double? StableF { get; set; } - - /// status flag - [ParseInfo(29, units: "NA")] - public string Status { get; set; } - - /// DeltaF/Fm, the fraction of absorbed PSII photons that are used in photochemistry - [ParseInfo(30, units: "NA")] - public double? PhiPS2 { get; set; } - - /// atmospheric O2 partial pressure - [ParseInfo(31, units: "Pa")] - public double? OxygenPress { get; set; } - } -} + [ParseInfo(10, exampleValue: "Any extra information you feel would be helpful to put the sampled leaf in context")] + public string ExtraInfo { get; set; } + } +} \ No newline at end of file diff --git a/Core/Entities/LeafInputDataCurve.cs b/Core/Entities/LeafInputDataCurve.cs new file mode 100644 index 0000000..6cd8c15 --- /dev/null +++ b/Core/Entities/LeafInputDataCurve.cs @@ -0,0 +1,147 @@ +using System.ComponentModel.DataAnnotations; +using LeafWeb.Core.Utility; + +namespace LeafWeb.Core.Entities +{ + /// + /// A/Ci data for a variety of analyses, including photosynthesis, stomatal conductance, internal conductance, water use efficiency. + /// + public class LeafInputDataCurve + { + public int Id { get; set; } + + public virtual LeafInputData LeafInputInfo { get; set; } + + public int ListOrder { get; set; } + + /// the data point No. + [ParseInfo(1, units: "no unit")] + public double? Obs { get; set; } + + /// clock time + [StringLength(8)] + [ParseInfo(2, units: "hh:mm:ss")] + public string HHMMSS { get; set; } + + /// number of seconds since file opened + [ParseInfo(3, units: "seconds")] + public double? FTime { get; set; } + + /// photosynthetic rate + [ParseInfo(4, units: "umol/m2/s")] + public double? Photo { get; set; } + + /// adjusted photosynthetic rate (leakage corrected) + /// required + [ParseInfo(5, alternateTitle: "!AdjPhoto", units: "umol/m2/s")] + public double? AdjPhoto { get; set; } + + /// stomatal conductance + /// required + [ParseInfo(6, alternateTitle: "!StomCond", units: "mol/m2/s")] + public double? StomCond { get; set; } + + /// intercellular CO2 concentration (umol CO2 / mol moist air) + [ParseInfo(7, alternateTitle: "!Ci", units: "umol/mol")] + public double? Ci { get; set; } + + /// transpiration rate + /// must provide + [ParseInfo(8, alternateTitle: "!Trmmol", units:"mmol/m2/s")] + public double? Trmmol { get; set; } + + /// water vapor pressure deficit based on leaf temperature, must provide + [ParseInfo(9, alternateTitle: "!VpdL", units: "KPa")] + public double? VpdL { get; set; } + + /// leaf area + [ParseInfo(10, units:"cm2")] + public double? Area { get; set; } + + /// estimate of the ratio of stomatal conductances of one side of the leaf to the other + [ParseInfo(11, units: "NA")] + public double? StmRat { get; set; } + + /// total boundary layer conductance + [ParseInfo(12, units: "mol/m2/s")] + public double? BLCond { get; set; } + + /// temperature in sample cell + [ParseInfo(13, units: "oC")] + public double? Tair { get; set; } + + /// temperature of leaf thermocouple + /// required + [ParseInfo(14, alternateTitle: "!Tleaf", units: "oC")] + public double? Tleaf { get; set; } + + /// IRGA Block temperature + [ParseInfo(15, units: "oC")] + public double? TBlk { get; set; } + + /// reference CO2 concentration + [ParseInfo(16, units: "umol/mol")] + public double? CO2R { get; set; } + + /// Sample CO2 concentration + [ParseInfo(17, units: "umol/mol")] + public double? CO2S { get; set; } + + /// reference cell water vapor concentration + [ParseInfo(18, units: "mmol/mol")] + public double? H2OR { get; set; } + + /// sample cell water vapor concentration + [ParseInfo(19, units: "mmol/mol")] + public double? H2OS { get; set; } + + /// (%) Reference cell relative humidity + [ParseInfo(20)] + public double? RH_R { get; set; } + + /// (%) sample cell relative humidity + [ParseInfo(21)] + public double? RH_S { get; set; } + + /// (umol/s) molar flow rate of air entering the leaf chamber + [ParseInfo(22)] + public double? Flow { get; set; } + + /// PAR measured by the in-chamber quantum sensor + /// required + [ParseInfo(23, alternateTitle: "!PARi", units: "umol/m2/s")] + public double? PARi { get; set; } + + /// PAR measured by the external quantum sensor + [ParseInfo(24, units: "umol/m2/s")] + public double? PARo { get; set; } + + /// atmospheric pressure + [ParseInfo(25, units: "KPa")] + public double? Press { get; set; } + + /// sample CO2 offset + [ParseInfo(26, units: "umol/mol")] + public double? CsMch { get; set; } + + /// sample H2O offset + [ParseInfo(27, units: "mmol/mol")] + public double? HsMch { get; set; } + + /// a stability indicator as a decimal value + [ParseInfo(28, units: "NA")] + public double? StableF { get; set; } + + /// status flag + [ParseInfo(29, units: "NA")] + public string Status { get; set; } + + /// DeltaF/Fm, the fraction of absorbed PSII photons that are used in photochemistry + [ParseInfo(30, units: "NA")] + public double? PhiPS2 { get; set; } + + /// atmospheric O2 partial pressure + [ParseInfo(31, units: "Pa")] + public double? OxygenPress { get; set; } + } +} diff --git a/Core/Entities/LeafInputPhotosynthetic.cs b/Core/Entities/LeafInputDataPhotosynthetic.cs similarity index 92% rename from Core/Entities/LeafInputPhotosynthetic.cs rename to Core/Entities/LeafInputDataPhotosynthetic.cs index 896c55d..517dd14 100644 --- a/Core/Entities/LeafInputPhotosynthetic.cs +++ b/Core/Entities/LeafInputDataPhotosynthetic.cs @@ -5,11 +5,11 @@ namespace LeafWeb.Core.Entities /// /// Photosynthetic parameters of Leaf Input /// - public class LeafInputPhotosynthetic + public class LeafInputDataPhotosynthetic { public int Id { get; set; } - public virtual LeafInputInfo LeafInputInfo { get; set; } + public virtual LeafInputData LeafInputInfo { get; set; } /// chloroplastic CO2 photocompensation point /// must be positive diff --git a/Core/Entities/LeafInputSite.cs b/Core/Entities/LeafInputDataSite.cs similarity index 97% rename from Core/Entities/LeafInputSite.cs rename to Core/Entities/LeafInputDataSite.cs index 427348a..f709cc3 100644 --- a/Core/Entities/LeafInputSite.cs +++ b/Core/Entities/LeafInputDataSite.cs @@ -5,11 +5,11 @@ namespace LeafWeb.Core.Entities /// /// Contains info about the site such as elevation, canopy height, site ID, etc /// - public class LeafInputSite + public class LeafInputDataSite { public int Id { get; set; } - public virtual LeafInputInfo LeafInputInfo { get; set; } + public virtual LeafInputData LeafInputInfo { get; set; } /// Site identifier /// do not leave blank between letters diff --git a/Core/Entities/LeafInputInfo.cs b/Core/Entities/LeafInputInfo.cs deleted file mode 100644 index 15b3682..0000000 --- a/Core/Entities/LeafInputInfo.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Collections.Generic; -using LeafWeb.Core.Utility; - -namespace LeafWeb.Core.Entities -{ - /// - /// Descriptive information about the investigator, - /// contact information, the site,the sample leaf and its general environmental condition - /// - public class LeafInputInfo - { - public int Id { get; set; } - - public virtual LeafInputSite Site { get; set; } - public virtual LeafInputPhotosynthetic Photosynthetic { get; set; } - public virtual ICollection Data { get; set; } - - [ParseInfo(1, exampleValue: "First and last name")] - public string InvestigatorName { get; set; } - - [ParseInfo(2, exampleValue: "Your email / mail addresses")] - public string ContactInformation { get; set; } - - [ParseInfo(3, alternateTitle: "Site name in full", exampleValue: "Your site's identifier / name")] - public string SiteName { get; set; } - - [ParseInfo(4, exampleValue: "Mixed forest / grasslands / croplands/ etc")] - public string VegetationType { get; set; } - - [ParseInfo(5, exampleValue: "Soil type at your site")] - public string SoilType { get; set; } - - [ParseInfo(6, exampleValue: "List of major species at the site")] - public string MajorSpecies { get; set; } - - [ParseInfo(7, - alternateTitle: "Sample leaf light environment", - exampleValue: "The general light environment in which the leaf is in (e.g. heavily shaded from above)")] - public string SampleLeafLightEnv { get; set; } - - [ParseInfo(8, exampleValue: "Indicate whether there is water stress at the time of sampling")] - public string WaterStressAssessment { get; set; } - - [ParseInfo(9, exampleValue: "For example - Licor-6400")] - public string InstrumentUsed { get; set; } - - [ParseInfo(10, exampleValue: "Any extra information you feel would be helpful to put the sampled leaf in context")] - public string ExtraInfo { get; set; } - } -} \ No newline at end of file diff --git a/Core/Entities/LeafOutputFile.cs b/Core/Entities/LeafOutputFile.cs new file mode 100644 index 0000000..afe412d --- /dev/null +++ b/Core/Entities/LeafOutputFile.cs @@ -0,0 +1,14 @@ + +namespace LeafWeb.Core.Entities +{ + public class LeafOutputFile + { + public int Id { get; set; } + + public virtual LeafInputFile LeafInputFile { get; set; } + + public string Filename { get; set; } + + public byte[] Contents { get; set; } + } +}