/// <summary> /// 构造函数 /// </summary> public PhaseWindUpCorrector(SatInfoFile satData, DataSourceContext DataSouceProvider) { this.Name = "相位缠绕距离改正"; this.CorrectionType = CorrectionType.PhaseWindUp; this.SatInfoService = satData; this.PhaseManager = new PhaseManager(); this.DataSouceProvider = DataSouceProvider; }
public override void Correct(EpochSatellite epochSatellite) { if (AntennaDataSource == null || SatInfoService == null) { return; } Time gpsTime = epochSatellite.RecevingTime; // XYZ sunPosition = epochSatellite.EpochInfo.DataSouceProvider.UniverseObjectProvider.GetSunPosition(gpsTime);// 这个可以每个历元算一次,有待优化。???czs 2014.10.05 //下面是新的计算太阳位置 Time tutc = gpsTime.GpstToUtc(); //查找地球自转信息 Gnsser.Data.ErpItem erpv = null; if (ErpDataService != null) { erpv = ErpDataService.Get(tutc); } if (erpv == null) { erpv = ErpItem.Zero; } XYZ sunPosition = new XYZ(); UniverseObjectProvider.GetSunPosition(gpsTime, erpv, ref sunPosition); IEphemeris sat = epochSatellite.Ephemeris; XYZ svPos = sat.XYZ; XYZ receiverPosition = epochSatellite.SiteInfo.EstimatedXyz; SatelliteNumber prn = epochSatellite.Prn; SatInfoFile periodSatInfoCollection = SatInfoService.SatInfoFile; IAntenna antenna = AntennaDataSource.Get(prn.ToString(), gpsTime); double correction = GetSatPhaseCenterCorectValue(prn, gpsTime, svPos, receiverPosition, sunPosition, periodSatInfoCollection, antenna); this.Correction = (correction);// }
/// <summary> /// 默认的卫星天线相位改正。 /// </summary> /// <param name="satelliteType"></param> /// <param name="time"></param> /// <param name="satPos"></param> /// <param name="sunPosition"></param> /// <returns></returns> public static double DefautSatPhaseCorrector(SatelliteNumber prn, Time time, XYZ satPos, XYZ ReceiverPosition, XYZ sunPosition, SatInfoFile satData) { // Unitary vector from satellite to Earth mass center (ECEF) XYZ satToEarthUnit = (-1.0) * satPos.UnitVector(); // Unitary vector from Earth mass center to Sun (ECEF) XYZ earthToSunUnit = sunPosition.UnitVector(); // rj = rk x ri: Rotation axis of solar panels (ECEF) XYZ rj = satToEarthUnit.Cross(earthToSunUnit); // Redefine ri: ri = rj x rk (ECEF) earthToSunUnit = rj.Cross(satToEarthUnit); // Let's funcKeyToDouble ri to an unitary vector. (ECEF) earthToSunUnit = earthToSunUnit.UnitVector(); // Get vector from Earth mass center to receiver XYZ receiverPos = ReceiverPosition; // Compute unitary vector vector from satellite to RECEIVER XYZ satToReceverUnit = (receiverPos - satPos).UnitVector(); // When not using Antex information, if satellite belongs to block // "IIR" its correction is 0.0, else it will depend on satellite model. // This variable that will hold the correction, 0.0 by default double svPCcorr = 0.0; // If no Antex information is given, or if phase center information // uses a relative model, then use a simpler, older approach // Please note that in this case all GLONASS satellite are // considered as having phase center at (0.0, 0.0, 0.0). The former // is not true for 'GLONASS-M' satellites (-0.545, 0.0, 0.0 ), but // currently there is no simple way to take this into account. // For satellites II and IIA: if ((satData.GetBlock(prn, time) == "II") || (satData.GetBlock(prn, time) == "IIA")) { //First, build satellite antenna vector for models II/IIA XYZ svAntenna = 0.279 * earthToSunUnit + 1.023 * satToEarthUnit; // Projection of "svAntenna" vector to line of sight vector rrho svPCcorr = (satToReceverUnit.Dot(svAntenna)); } else { // For satellites belonging to block "I" if ((satData.GetBlock(prn, time) == "I")) { // First, build satellite antenna vector for model I XYZ svAntenna = (0.210 * earthToSunUnit + 0.854 * satToEarthUnit); // Projection of "svAntenna" to line of sight vector (rrho) svPCcorr = (satToReceverUnit.Dot(svAntenna)); } } return(svPCcorr); }
/// <summary> /// 计算卫星相位中心改正值。 /// </summary> /// <param name="satelliteType">卫星编号</param> /// <param name="time">历元</param> /// <param name="satPos">卫星位置</param> /// <param name="sunPosition">太阳位置</param> /// <param name="satData">Name of "PRN_GPS"-like file containing satellite satData.</param> /// <returns></returns> public static double GetSatPhaseCenterCorectValue(SatelliteNumber prn, Time time, XYZ satPos, XYZ ReceiverPosition, XYZ sunPosition, SatInfoFile satData, IAntenna antenna = null) { if (antenna == null) { return(0); } // This variable that will hold the correction, 0.0 by default double svPCcorr = 0.0; // Check is Antex antenna information is available or not, and if // available, whether satellite phase center information is absolute or relative bool absoluteModel = false; if (antenna != null) { absoluteModel = antenna.Header.IsAbsolute; } if (absoluteModel) { //方法1:参考GPSTK // svPCcorr = GetPhaseCorrection(satelliteType, satPos, ReceiverPosition, sunPosition, svPCcorr, antenna); //方法2:参考RTKLIB svPCcorr = GetPhaseCorrection1(prn, satPos, ReceiverPosition, sunPosition, svPCcorr, antenna); } else// 采用一些默认的参数。 { svPCcorr = DefautSatPhaseCorrector(prn, time, satPos, ReceiverPosition, sunPosition, satData); } // This correction is interpreted as an "advance" in the signal, // instead of a delay. Therefore, it has negative sign return(svPCcorr); }
/// <summary> /// 改正 /// </summary> /// <param name="epochSatellite"></param> public override void Correct(EpochSatellite epochSatellite) { if (AntennaDataSource == null || SatInfoService == null) { return; } //Time gpsTime = epochSatellite.RecevingTime; Time emmissiontime = epochSatellite.EmissionTime; // XYZ sunPosition = epochSatellite.EpochInfo.DataSouceProvider.UniverseObjectProvider.GetSunPosition(gpsTime);// 这个可以每个历元算一次,有待优化。???czs 2014.10.05 //下面是新的计算太阳位置 //Time tutc = gpsTime.GpstToUtc(); //查找地球自转信息 Gnsser.Data.ErpItem erpv = null; if (ErpDataService != null) { //erpv = ErpDataService.Get(tutc); erpv = ErpDataService.Get(emmissiontime); } if (erpv == null) { erpv = ErpItem.Zero; } XYZ sunPosition = new XYZ(); UniverseObjectProvider.GetSunPosition(emmissiontime, erpv, ref sunPosition); //UniverseObjectProvider.GetSunPosition(gpsTime, erpv, ref sunPosition); IEphemeris sat = epochSatellite.Ephemeris; XYZ svPos = sat.XYZ; XYZ receiverPosition = epochSatellite.SiteInfo.EstimatedXyz; var prn = epochSatellite.Prn; var satType = prn.SatelliteType; SatInfoFile periodSatInfoCollection = SatInfoService.SatInfoFile; IAntenna antenna = AntennaDataSource.Get(prn.ToString(), emmissiontime); if (antenna == null) { if (!noAntSats.Contains(prn)) { log.Warn(prn + " 没有获取到天线信息!"); noAntSats.Add(prn); } return; } List <RinexSatFrequency> frequences = epochSatellite.RinexSatFrequences; Dictionary <RinexSatFrequency, double> correction = new Dictionary <RinexSatFrequency, double>(); GeoCoord rcvGeoCoord = epochSatellite.SiteInfo.ApproxGeoCoord; int i = 0; foreach (var item in frequences) { double rang = GetSatPhaseCenterCorectValue(prn, item, emmissiontime, svPos, receiverPosition, rcvGeoCoord, sunPosition, periodSatInfoCollection, antenna); if (rang != 0 && frequences.Count > i) { correction.Add(frequences[i], rang); } i++; } this.Correction = (correction);// }