Exemplo n.º 1
0
        private void button_run_Click(object sender, EventArgs e)
        {
            GeoCoord geoCoord = GeoCoord.Parse(this.textBox_geoCoord.Text);
            var      time     = this.dateTimePicker1.Value;
            var      gpsTime  = Time.Parse(time);

            #region 方案1 : Neill模型
            var elevation = geoCoord.Height;
            var pTroModel = new NeillTropModel(geoCoord.Height, geoCoord.Lat, gpsTime.DayOfYear);

            var wetMap = pTroModel.Wet_Mapping_Function(elevation);

            var correction = GetTroposphericCorectValueWithNillModel(elevation, geoCoord, pTroModel);

            #endregion

            //#region 方案2: GMF 模型 , 崔阳, Added

            //double[] azel = new double[] { info.Azimuth * SunMoonPosition.D2R, info.Elevation * SunMoonPosition.D2R };

            //wetMap = 0.0;

            //double wetCorrectValue = epochSatellite.EpochInfo.ObsInfo.TropoCorrectValue;

            //correction = gTroModel.Correction(gpsTime, geoCoord, receiverPosition, azel, wetCorrectValue, ref wetMap);
            ////}
            //#endregion

            //#region 方案3: VMF 模型 , 李林阳 added
            //      else
            //{

            //string stanam = epochSatellite.obsPath.MarkerName;

            ////double WetMap = 0.0;
            ////采用VMF1模型~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,李林阳添加
            //this.VMF1TroModel = new VMF1TropModel(DataSourceProvider, stanam, geoCoord.Height, geoCoord.Lat * CoordConsts.DegToRadMultiplier, gpsTime);
            //wetMap = 0;
            ////采用VMF1模型,GetSatPhaseCenterCorectValue函数也要作出改变~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,李林阳添加
            ////double correction = GetSatPhaseCenterCorectValue(elevation, geoCoord, VMF1TroModel,ref WetMap);
            //correction = VMF1TroModel.Correction(elevation, ref wetMap);

            //epochSatellite.Vmf1WetMap = wetMap;
            ////}
            //#endregion


            //epochSatellite.WetMap = wetMap;

            ShowInfo(correction);
        }
Exemplo n.º 2
0
        public override void Correct(EpochSatellite epochSatellite)
        {
            if (!epochSatellite.HasEphemeris)
            {
                return;
            }
            Time gpsTime = epochSatellite.RecevingTime;

            XYZ receiverPosition = epochSatellite.SiteInfo.EstimatedXyz;

            if (!receiverPosition.IsValid || receiverPosition.IsZero)
            {
                this.Correction = 0;
                return;
            }
            Polar p = epochSatellite.Polar;

            double elevation = p.Elevation;

            GeoCoord geoCoord = epochSatellite.SiteInfo.ApproxGeoCoord;


            #region Test

            //double FE_WGS84 = 1.0 / 298.257223563;
            //double RE_WGS84 = 6378137.0;

            //double e2 = FE_WGS84 * (2.0 - FE_WGS84);
            //double v = RE_WGS84;
            //XYZ r = epochSatellite.obsPath.ApproxXyz;
            //double r2 = r.X * r.X + r.Y * r.Y;
            //double sinp, z, zk;

            //for (z = r.Z, zk = 0.0; Math.Abs(z - zk) >= 1E-4; )
            //{
            //    zk = z;
            //    sinp = z / Math.Sqrt(r2 + z * z);
            //    v = RE_WGS84 / Math.Sqrt(1.0 - e2 * sinp * sinp);
            //    z = r.Z + v * e2 * sinp;
            //}

            //double pos0 = r2 > 1E-12 ? Math.Atan(z / Math.Sqrt(r2)) : (r.Z > 0.0 ? AstronomicalFunctions.PI / 2.0 : -AstronomicalFunctions.PI / 2.0);//lat
            //double pos1 = r2 > 1E-12 ? Math.Atan2(r.Y, r.Z) : 0.0; //lon
            //double pos2 = Math.Sqrt(r2 + z * z) - v;
            //GeoCoord geoCoord0 = new GeoCoord(pos1 * AstronomicalFunctions.R2D, pos0 * AstronomicalFunctions.R2D, pos2);

            //if (geoCoord != geoCoord0) geoCoord = geoCoord0;

            #endregion


            double   wetMap = 0.0, correction = 0.0;
            double[] azel            = new double[] { p.Azimuth *AngularTransformer.DegToRadMultiplier, p.Elevation *AngularTransformer.DegToRadMultiplier };
            double   wetCorrectValue = epochSatellite.EpochInfo.NumeralCorrections[Gnsser.ParamNames.WetTropZpd];

            //首先尝试


            #region 方案4: GpT2 模型 , 李林阳 added
            if (this.DataSourceProvider.gpt2DataService1Degree != null || this.DataSourceProvider.gpt2DataService != null)
            {
                this.gpt2Model = new Gpt2TropModel(DataSourceProvider);
                //返回干分量和湿分量对流层延迟的估值,wetMap 为湿分量映射函数,用于作为残余天定距参数的斜距映射。
                correction = gpt2Model.Correction(gpsTime, geoCoord, receiverPosition, azel, wetCorrectValue, ref wetMap);
            }
            #endregion


            //天顶对流层延迟,高度角为90度
            double[] azel2      = new double[] { p.Azimuth *SunMoonPosition.DegToRad, Math.PI / 2 };
            double   wetMap_ZTD = 0;
            //double appriorWetDealy_ZTD = 0;
            double ZTD = gpt2Model.Correction(gpsTime, geoCoord, receiverPosition, azel2, wetCorrectValue, ref wetMap_ZTD);
            epochSatellite.AppriorTropDelay = ZTD;
            epochSatellite.WetMap_ZTD       = wetMap_ZTD;



            if (wetMap == 0 && correction == 0)
            {
                #region 方案2: GMF 模型 , 崔阳, Added
                if (DataSourceProvider == null || DataSourceProvider.Vmf1DataService == null || DataSourceProvider.Vmf1DataService.Count == 0)
                {
                    correction = gTroModel.Correction(gpsTime, geoCoord, receiverPosition, azel, wetCorrectValue, ref wetMap);
                }
                #endregion
            }
            if (wetMap == 0 && correction == 0)
            {
                #region 方案1 : Neill模型

                this.pTroModel = new NeillTropModel(geoCoord.Height, geoCoord.Lat, gpsTime.DayOfYear);
                wetMap         = pTroModel.Wet_Mapping_Function(elevation);
                correction     = GetTroposphericCorectValueWithNillModel(elevation, geoCoord, pTroModel);
                #endregion
            }

            if (wetMap == 0 && correction == 0)
            {
                #region 方案3: VMF 模型 , 李林阳 added
                string stanam = epochSatellite.SiteInfo.SiteName;

                //double WetMap = 0.0;
                //采用VMF1模型~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,李林阳添加
                this.VMF1TroModel = new VMF1TropModel(DataSourceProvider, stanam, geoCoord.Height, geoCoord.Lat * AngularTransformer.DegToRadMultiplier, gpsTime);
                wetMap            = 0;
                //采用VMF1模型,GetSatPhaseCenterCorectValue函数也要作出改变~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~,李林阳添加
                //double correction = GetSatPhaseCenterCorectValue(elevation, geoCoord, VMF1TroModel,ref WetMap);
                correction = VMF1TroModel.Correction(elevation, ref wetMap);

                epochSatellite.Vmf1WetMap = wetMap;

                #endregion
            }

            epochSatellite.WetMap = wetMap;

            this.Correction = correction;

            //对流层增强
            double augment = 0.0;
            if (this.IsTropAugmentEnabled && DataSourceProvider.TropAugService != null)
            {
                augment         = DataSourceProvider.TropAugService.Correction(epochSatellite.RecevingTime);
                this.Correction = correction + wetMap * augment;
            }
        }