Exemplo n.º 1
0
        private void ConstructFullLJVDataListAndCSV(string fp)
        {
            FullLJVDataList = new List <FullLJVDatum>();
            foreach (RawLJVDatum rawdat in RawLJVDataList)
            {
                try
                {
                    ProcessedLJVDatum procdat  = ProcLJVDataList.Where(x => x.Voltage == rawdat.Voltage).First();
                    FullLJVDatum      newDatum = new FullLJVDatum();
                    if (rawdat.PhotoCurrentA != 0)
                    {
                        newDatum = new FullLJVDatum()
                        {
                            Voltage            = rawdat.Voltage,
                            Current            = rawdat.Current,
                            CurrentDensity     = procdat.CurrentDensity,
                            Resistance         = rawdat.Resistance,
                            PhotoCurrentA      = rawdat.PhotoCurrentA,
                            PhotoCurrentB      = rawdat.PhotoCurrentB,
                            PhotoCurrentC      = rawdat.PhotoCurrentC,
                            CameraCIEx         = rawdat.CameraCIEx,
                            CameraCIEy         = rawdat.CameraCIEy,
                            CameraLuminance    = rawdat.CameraLuminance,
                            Luminance          = procdat.Luminance,
                            CurrentEff         = procdat.CurrentEff,
                            PowerEff           = procdat.PowerEff,
                            EQE                = procdat.EQE,
                            PCurrChangePercent = ((rawdat.PhotoCurrentC / rawdat.PhotoCurrentA) - 1) * 100,
                            TimeStamp          = rawdat.TimeStamp
                                                 //generate method to find ELSpecPaths from SpectrumAtEachStep function
                        };
                    }

                    FullLJVDataList.Add(newDatum);
                }
                catch (Exception e)
                {
                    Debug.WriteLine("error at LJVScanVM ConstructFullLJVDataListAndCSV: " + e.ToString());
                }
            }
            DataProcessingService.WriteIENumberableToCSV(FullLJVDataList, fp);
        }
Exemplo n.º 2
0
        public void PopulatePropertiesFromPath(string fp)
        {
            TheLJVScan.ProcDATFilePath = fp;
            LoadProcLJVDataIntoList(fp);
            TrimEfficiencies();
            TheLJVScan.TimeWhenAcquired = File.GetCreationTime(fp);
            TheLJVScan.MaxEQE           = Math.Round(Convert.ToDecimal(ProcLJVDataList.Max(x => x.EQE)), 1);
            TheLJVScan.MaxCE            = Math.Round(Convert.ToDecimal(ProcLJVDataList.Max(x => x.CurrentEff)), 1);
            TheLJVScan.MaxPE            = Math.Round(Convert.ToDecimal(ProcLJVDataList.Max(x => x.PowerEff)), 1);
            TheLJVScan.MaxVoltage       = Math.Round(Convert.ToDecimal(ProcLJVDataList.Max(x => x.Voltage)), 1);
            int maxEQEIndex = ProcLJVDataList.IndexOf(ProcLJVDataList.Where(x => x.EQE == ProcLJVDataList.Max(y => y.EQE)).First());

            TheLJVScan.LuminanceAtMaxEQE = Math.Round(Convert.ToDecimal(ProcLJVDataList[maxEQEIndex].Luminance));
            Debug.WriteLine("Found max EQE to be: " + TheLJVScan.MaxEQE + " with luminance: " + TheLJVScan.LuminanceAtMaxEQE);
            //find indices of data for luminance before and after 500 nits
            var listMaxLuminance = ProcLJVDataList.Max(x => x.Luminance);

            if (listMaxLuminance < 10.0m)
            {
                TheLJVScan.PixelLitUp = false;
            }
            else
            {
                TheLJVScan.PixelLitUp = true;
            }
            if (listMaxLuminance > 1000.0m)
            {
                int i = ProcLJVDataList.Count() - 1;
                if (listMaxLuminance > ProcLJVDataList.Last().Luminance) //special case where the luminance reaches a peak value and drops off
                {
                    i = ProcLJVDataList.IndexOf(ProcLJVDataList.Where(x => x.Luminance == listMaxLuminance).First());
                }
                while (ProcLJVDataList[i].Luminance > 1000.0m)
                {
                    i--;
                }
                TheLJVScan.At1kNitsEQE            = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "EQE", 1000.0)), 1);
                TheLJVScan.At1kNitsCE             = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "CurrentEff", 1000.0)), 1);
                TheLJVScan.At1kNitsCurrentDensity = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "CurrentDensity", 1000.0)), 2);
                TheLJVScan.At1kNitsVoltage        = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "Voltage", 1000.0)), 2);
            }
            if (listMaxLuminance > 500.0m)
            {
                int i = ProcLJVDataList.Count() - 1;
                if (listMaxLuminance > ProcLJVDataList.Last().Luminance) //special case where the luminance reaches a peak value and drops off
                {
                    i = ProcLJVDataList.IndexOf(ProcLJVDataList.Where(x => x.Luminance == listMaxLuminance).First());
                }
                while (ProcLJVDataList[i].Luminance > 500.0m)
                {
                    i--;
                }
                TheLJVScan.At500NitsEQE            = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "EQE", 500.0)), 1);
                TheLJVScan.At500NitsCE             = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "CurrentEff", 500.0)), 1);
                TheLJVScan.At500NitsCurrentDensity = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "CurrentDensity", 500.0)), 2);
                TheLJVScan.At500NitsVoltage        = Math.Round(Convert.ToDecimal(FindInterpolatedValueForTargetLuminance(i, "Voltage", 500.0)), 2);
            }
            if (listMaxLuminance > 500.0m && listMaxLuminance < 1000.0m)
            {
                TheLJVScan.At1kNitsEQE            = 0;
                TheLJVScan.At1kNitsCE             = 0;
                TheLJVScan.At1kNitsCurrentDensity = 0;
                TheLJVScan.At1kNitsVoltage        = 0;
            }
            if (listMaxLuminance < 500.0m)
            {
                TheLJVScan.At500NitsEQE            = 0;
                TheLJVScan.At500NitsCE             = 0;
                TheLJVScan.At500NitsCurrentDensity = 0;
                TheLJVScan.At500NitsVoltage        = 0;
                TheLJVScan.At1kNitsEQE             = 0;
                TheLJVScan.At1kNitsCE             = 0;
                TheLJVScan.At1kNitsCurrentDensity = 0;
                TheLJVScan.At1kNitsVoltage        = 0;
            }
        }