Exemple #1
0
        /// <summary>
        /// Contains all of the parameters for all of the fits. The format of which is determined in the class
        /// </summary>
        /// <param name="FullParameterArray"></param>
        /// <param name="ParameterArraysize"></param>
        /// <param name="paramsize"></param>
        /// <param name="FullChisquareArray"></param>
        /// <param name="FullCovariance"></param>
        /// <param name="Refl"></param>
        public StochOutputWindow(double[] FullParameterArray, int ParameterArraysize, int paramsize, double[] FullChisquareArray, double[] FullCovariance, double[] info, BoxReflFitBase Refl)
        {
            InitializeComponent();
            ReflectivityList = new List <BoxReflFitBase>(100);
            _StochWindow     = true;
            //Fill the ParameterArray
            double[] param   = new double[paramsize];
            double[] covar   = new double[paramsize];
            double[] locinfo = new double[9];
            for (int i = 0; i < ParameterArraysize; i++)
            {
                ReflectivityList.Add(Refl.CreateLightWeightClone());

                for (int j = 0; j < paramsize; j++)
                {
                    param[j] = FullParameterArray[i * paramsize + j];
                    covar[j] = FullCovariance[i * paramsize + j];
                }

                for (int k = 0; k < 9; k++)
                {
                    locinfo[k] = info[i * 9 + k];
                }

                ReflectivityList[i].UpdatefromParameterArray(param);
                ReflectivityList[i].CovarArray = covar;
                ReflectivityList[i].Fitinfo    = locinfo;
                ReflectivityList[i].ChiSquare  = FullChisquareArray[i];
            }

            //Fill the list
            for (int i = 0; i < ParameterArraysize; i++)
            {
                ModelLB.Items.Add("Model " + (i + 1).ToString() + " - Fit Score = " + FullChisquareArray[i].ToString("#.### E-000"));
            }

            SetUpGraphs(Refl.SubphaseSLD, Refl.SuperphaseSLD);


            ReflectivityList.ForEach(p => p.UpdateProfile());

            ModelLB.SelectedIndex = 0;
            ModelLB.Focus();

            //Play a chime when the stochastic methods are complete
            System.Media.SystemSounds.Exclamation.Play();
        }
Exemple #2
0
 public void AddModel(BoxReflFitBase BoxRefl)
 {
     ReflectivityList.Add(BoxRefl.CreateLightWeightClone());
     ModelLB.Items.Add("Model " + (ModelLB.Items.Count + 1).ToString() + " - Fit Score = " + BoxRefl.ChiSquare.ToString("#.### E-000"));
     ReflectivityList[ReflectivityList.Count - 1].UpdateProfile();;
 }