/// <summary>
 /// Конструктор для створення об'єкту ReferenceSystem з параметрами за замовчуванням
 /// </summary>
 public ReferenceSystem(ReferenceSystem.Default defaulParams, double satelliteSphere = 6500000)
 {
     //Система "вільна від припливних чинників"
     //http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008/egm08_wgs84.html
     if (defaulParams == Default.TideFree)
     {
         this.GM              = 0.3986004415E+15;
         this.a               = 6378136.46;
         this.f               = (double)1 / 298.257686;
         this.omega           = 7292115E-11;
         this.gridParameters  = new Grid(1.6, 25);
         this.maxDegree       = 90;
         this.satelliteSphere = satelliteSphere;
         mainInit();
     }
     if (defaulParams == Default.ITRF)
     {
         this.GM              = 3.986004418E14;
         this.a               = 6378136.6;
         this.f               = (double)1 / 298.25642;
         this.omega           = 7292115E-11;
         this.gridParameters  = new Grid(1.6, 25);
         this.maxDegree       = 90;
         this.satelliteSphere = satelliteSphere;
         mainInit();
     }
     if (defaulParams == Default.WGS84)
     {
         this.GM              = 3986004.418E8;
         this.a               = 6378137;
         this.f               = (double)1 / 298.257223563;
         this.omega           = 7292115E-11;
         this.gridParameters  = new Grid(1.6, 25);
         this.maxDegree       = 90;
         this.satelliteSphere = satelliteSphere;
         mainInit();
     }
     if (defaulParams == Default.USC2000)
     {
         this.GM              = 3.986004418E14;
         this.a               = 6378245;
         this.f               = (double)1 / 298.3;
         this.omega           = 7292115E-11;
         this.gridParameters  = new Grid(1.6, 25);
         this.maxDegree       = 90;
         this.satelliteSphere = satelliteSphere;
         mainInit();
     }
 }
Exemplo n.º 2
0
 private void button8_Click(object sender, EventArgs e)
 {
     ts2  = new CancellationTokenSource();
     ct2  = ts2.Token;
     ct_p = ts_p.Token;
     tabControl1.SelectedTab = tabControl1.TabPages[1];
     this.Refresh();
     ReferenceSystem.Default def = (ReferenceSystem.Default)listBox1.SelectedItem;
     відмінитиПоточнуОпераціюToolStripMenuItem.Enabled = true;
     var task = Task.Factory.StartNew(() =>
     {
         addText("Обчислення розпочато...\r\n");
         string file     = SphericalHarmonicAnalyze.Properties.Settings.Default.inGravityModel;
         GravityModel gm = new GravityModel(SphericalHarmonicAnalyze.Properties.Settings.Default.modelMaxOrder);
         gm.loadFromFile(SphericalHarmonicAnalyze.Properties.Settings.Default.inGravityModel, new setProgressDel(addVal));
         ReferenceSystem elipsoid                 = new ReferenceSystem(def);
         elipsoid.gridParameters.cellSize         = SphericalHarmonicAnalyze.Properties.Settings.Default.GridCellSize;
         elipsoid.gridParameters.coLatitudeBounds = SphericalHarmonicAnalyze.Properties.Settings.Default.minCoLatitude;
         elipsoid.maxDegree = SphericalHarmonicAnalyze.Properties.Settings.Default.modelMaxOrder;
         int greedColumnsCount, greedRowsCount;
         List <double[]> greed = MathFunc.generateGrid(elipsoid.gridParameters.cellSize, out greedColumnsCount, out greedRowsCount, SphericalHarmonicAnalyze.Properties.Settings.Default.minCoLatitude, SphericalHarmonicAnalyze.Properties.Settings.Default.maxCoLatitude, SphericalHarmonicAnalyze.Properties.Settings.Default.longW, SphericalHarmonicAnalyze.Properties.Settings.Default.longE);
         addText("Колонок: {0}\r\n", greed.Count);
         double[][] h_dg = GravityModel.getGeoidHeightAndAnomalys(elipsoid, gm, greed, d: new setProgressDel(addVal), ct: ct2, ct2: ct_p);
         if (ct2.IsCancellationRequested)
         {
             addText("Перервано...\r\n"); addVal(0, 1, ""); Thread.CurrentThread.Abort();
         }
         ;
         addText("dg обчислено\r\n");
         IOFunc.writeGeoidHeightsAndAnomalysToTxt(greed, h_dg[0], h_dg[1], elipsoid, file + "B_L_N_dg.txt");
         addText("Готово...\r\nРезультати записано в файл: " + file + "NEW____________B_L_N_dg.txt\r\n");
     }, ct2);
     var t3 = Task.Factory.StartNew(() => {
         label1:  if (task.IsCompleted)
         {
             if (checkBox1.Checked)
             {
                 System.Diagnostics.Process.Start("rundll32.exe", "powrprof.dll,SetSuspendState 0,1,0");
             }
             ;
         }
         else
         {
             task.Wait(); goto label1;
         }
     });
 }