private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e) { if (calculater == null) { Geo.Utils.FormUtil.ShowWarningMessageBox("请先读取数据。"); return; } var coordStr = this.namedStringControlCoord.GetValue(); double val = 0; if (this.radioButtonLonLat.Checked) { var radius = HeightOnSphere + AveRadiusOfEarch; LonLat lonlat = LonLat.Parse(coordStr); //转换为日固坐标系 LonLat lonLatSE = lonlat.GetSeLonLat(this.CurrentHarmanicsData.Time.DateTime); val = calculater.GetValue(maxOrder, lonLatSE, radius); } else { XYZ xyz = XYZ.Parse(coordStr); var polar = Geo.Coordinates.CoordTransformer.XyzToPolar(xyz); var lonlat = new LonLat(polar.Azimuth, polar.Elevation); LonLat lonLatSE = lonlat.GetSeLonLat(this.CurrentHarmanicsData.Time.DateTime); val = calculater.GetValue(maxOrder, lonLatSE, polar.Range); } var span = DateTime.Now - Start; Geo.Utils.FormUtil.SetText(this.richTextBoxControl1, "计算值:" + val + ",耗时 : " + span + ""); log.Info("计算完毕! ,计算值:" + val + ",耗时 : " + span + ""); }
/// <summary> /// 垂直方向的电子数量 /// </summary> /// <param name="time"></param> /// <param name="geocentricLonlatDeg"></param> /// <param name="data"></param> /// <returns></returns> private static RmsedNumeral GetValue(Time time, LonLat geocentricLonlatDeg, IonoHarmonicSection data) { SphericalHarmonicsCalculater calculater = new SphericalHarmonicsCalculater(data); var radius = Geo.Referencing.Ellipsoid.MeanRaduis; // HeightOnSphere + AveRadiusOfEarch; LonLat lonLatSE = geocentricLonlatDeg.GetSeLonLat(time.DateTime); //转换为日固坐标系 var val = calculater.GetValue(data.MaxDegree, lonLatSE, radius); return(new RmsedNumeral(val, 0)); }