public SimWindow(EPRPlotView plotView) { InitializeComponent(); //garlic mode is default spiceImg.Source = BluEPRint2.Properties.Resources.garlic.ToBitmapImage(); this.plotView = plotView; this.spc = plotView.spc; //setup exp params this.exp = new Exp(spc.freq, spc.getX().Length, spc.getX().First(), spc.getX().Last()); Load(); this.ExpTBlock.Text = "Experimental Data: \nFrequency: " + exp.frequency + " GHz \nRange: " + spc.getX().First() + " - " + spc.getX().Last() + " mT\nResolution: " + spc.getX().Length + " Points"; }
public double[] AddSim(Sys sys, Exp exp, EPRSpectrum spc) { EasySpinHelper matlab = new EasySpinHelper(Properties.Settings.Default.es_plug); matlab.SetPath(Properties.Settings.Default.es_path); matlab.Execute("clc, clear"); matlab.Put("y", spc.getY()); if (sys.Spin > 0.5) { matlab.pepper(sys, exp); } else { matlab.garlic(sys, exp); } matlab.Execute("spc = rescale(spc,y,'lsq0');"); matlab.Execute("spc = spc - max(y)/2"); object data = matlab.Get("spc"); double[,] datax = (double[, ])data; double[] y = BPUtil.singleCol(datax); return(y); }