Ejemplo n.º 1
0
        private void btnISM_StartMapping_Click(object sender, EventArgs e)
        {
            double polesMagStr;
            double polesLong;
            double polesCoLat;
            double inc;
            double regPar;
            double logL;
            int    n, m;

            try
            {
                polesMagStr = double.Parse(txtISM_PolesMagStr.Text.Replace(".", ",")) * 1e6;
                polesLong   = double.Parse(txtISM_PolesLongitude.Text.Replace(".", ",")) * Math.PI / 180;
                polesCoLat  = double.Parse(txtISM_PolesColatitude.Text.Replace(".", ",")) * Math.PI / 180;
                inc         = double.Parse(txtISM_Inclination.Text.Replace(".", ",")) * Math.PI / 180;
                regPar      = double.Parse(txtISM_RegulParameter.Text.Replace(".", ","));
                n           = int.Parse(txtISM_LatBeltsNumber.Text);
                m           = int.Parse(txtISM_LongBeltsNumber.Text);
                logL        = double.Parse(txtLogL.Text.Replace(".", ","));
            }
            catch
            {
                MessageBox.Show("Wrong format of input data...", "Error...");
                return;
            }

            //StokesImaging.WM85Interpolator wm85 = new Maper.StokesImaging.WM85Interpolator();


            spp_ism = new Maper.StokesImaging.StokesParsProvider(
                txtISM_IPath.Text,
                txtISM_QPath.Text,
                txtISM_VPath.Text
                );

            StokesImaging.MagnetizedSurface srf = new Maper.StokesImaging.MagnetizedSurface(inc, polesCoLat, polesLong,
                                                                                            polesMagStr, n, m, 1);

            sm = new Maper.StokesImaging.StokesMapper(srf,
                                                      spp_ism.GetStokesPars, this.stokesCurvesBox.StokesCurves);

            txtIS_Results.AppendText("\r\nStart imaging procedure...");
            MathLib.Counter counter = new MathLib.Counter();
            counter.Start();
            sm.StartMapping(regPar, Math.Pow(10, logL), Application.StartupPath);
            counter.Stop();
            txtIS_Results.AppendText(
                string.Format("\r\nDone!\r\nComputings duration is: {0} sec",
                              counter.TotalSeconds.ToString()));

            this.magSrfRes = sm.ResultSurface;
        }
Ejemplo n.º 2
0
        private void btnSM_ShowMap_Click(object sender, EventArgs e)
        {
            if (this.magSrf == null)
            {
                MessageBox.Show("Surface was not created...", "Error...");
                return;
            }
            int part_flag = 1;

            if (cbSI_PartSimple.Checked)
            {
                part_flag = 0;
            }

            StokesImaging.MagnetizedSurface boolSrf = new Maper.StokesImaging.MagnetizedSurface(0.0, 0.0, 0.0, 0.0,
                                                                                                this.magSrf.NLat, this.magSrf.NLong, part_flag);

            if (this.arcInitBox == null)
            {
                return;
            }

            for (int i = 0; i < this.arcInitBox.SpotsNumber; i++)
            {
                boolSrf.AddRectSpot(this.arcInitBox.spots[i].colatitude1 * Math.PI / 180,
                                    this.arcInitBox.spots[i].colatitude2 * Math.PI / 180,
                                    this.arcInitBox.spots[i].longitude1 * Math.PI / 180,
                                    this.arcInitBox.spots[i].longitude2 * Math.PI / 180,
                                    this.arcInitBox.spots[i].brightness);
            }

            SurfaceViewerForm svf = new SurfaceViewerForm();

            svf.color0 = Color.White;
            svf.color1 = Color.Black;
            svf.Init(boolSrf.GetPatchCoordMas(), boolSrf.GetBrightnessDensityMas());
            svf.ShowDialog();
        }