public static void ExportDataDEPRECATED(string FullFileName, GrowthCurveCollection GCC) { bool LagData = false; //FullFileName = "C:\\FullName.csv"; StreamWriter SW = new StreamWriter(FullFileName); SW.WriteLine("Fitted Data Results"); SW.WriteLine("Name, Doubling Time(Hrs),Growth Rate, How Determined?,NumPoints,R2,RMSE, Maximum GrowthRate,MaxOD,Notes,Linear-Fit Slope,Reduction in absolute error from ExpFit,LagTime,Reduction in Sum of Squares from Exp Fit,TimeTill_OD_0.02,EndOD,TreatmentGroup"); string TitleLine = "Time,";//this will hold the titles for everything below foreach (GrowthCurve GR in GCC) { LagData = false; TitleLine += GR.ToString() + " OD," + "Flag,"; string newline = GR.ToString() + ","; double ActualGrowth = Math.Log(2) / GR.GrowthRate.GrowthRate; if (GR.ValidDataSet) { newline += ActualGrowth.ToString("n5") + "," + GR.GrowthRate.GrowthRate.ToString() + "," + GR.GrowthRate.FittingUsed + "," + GR.GrowthRate.NumPoints + "," + GR.GrowthRate.R2.ToString("n4") + "," + GR.GrowthRate.RMSE.ToString("n5") + "," + GR.MaxGrowthRate.MaxGrowthRate.ToString("n5") + "," + GR.ODValues.Max().ToString("n4") + "," + GR.GrowthRate.Notes; if (GR.LinearModelFitted && GR.ExpModelFitted) { double dif = GR.LinFit.AbsError - GR.ExpFit.AbsError; double dif2 = GR.LinFit.calculateResidualSumofSquares() - GR.ExpFit.calculateResidualSumofSquares(); newline += "," + GR.LinFit.Parameters[1].ToString("n5") + "," + dif.ToString("n5") + ",DEPRECATED," + dif2.ToString("n5") + ","; }//+","+RMSEdiff.ToString("n5")+","+GR.LinFit.RMSE.ToString()+","+GR.ExpFit.RMSE.ToString(); }//report the linear fitted slope if possible else { newline += ",No Exp Fit to Compare Against,"; } newline += GR.HoursTillODReached(.02).ToString() + ","; newline += GR.ODValues.Last().ToString() + ","; } else { newline += ",,Weird Data:Blank??,,,,,,,,,,,,,"; } SW.WriteLine(newline); } //Below assumes the time is the same for all of them string Intermissionline = "Complete Data Listing Below"; if (LagData) { Intermissionline += "-Initial OD Present"; } ; SW.WriteLine(Intermissionline); SW.WriteLine(TitleLine); HashSet <DateTime> dtimes = new HashSet <DateTime>(); foreach (GrowthCurve gc in GCC) { foreach (DateTime dt in gc.Select((x) => x.time)) { dtimes.Add(dt); } } List <DateTime> DateTimesinFile = dtimes.Select((x) => x).ToList(); DateTimesinFile.Sort(); foreach (DateTime DT in DateTimesinFile) { string line = DT.ToString() + ","; foreach (GrowthCurve GR in GCC) { int indexPos = -1; DateTime[] timeValues = GR.Times; if (SimpleFunctions.ValueInArray(timeValues, DT, ref indexPos)) { //decide if this timepoint was included line += GR.ODValues[indexPos].ToString() + ","; double DateX = GR[indexPos].time_as_double; if (GR.FittedXValues != null && SimpleFunctions.ValueInArray(GR.FittedXValues, DateX)) //now decide if it made it into the fit { line += "0,"; } else { line += "1,"; } } else { line += "-999,-999,"; } } SW.WriteLine(line); } SW.Close(); }