/// <summary> /// 两个文件合并,本方法只适合计算站点不重复,且不相关的情况。 /// 信息只是简单的叠加。只有两个文件都有的信息块才会被合并。 /// </summary> /// <param name="fileB"></param> /// <param name="eraseNonCoord"> 是否清理非坐标的值和对应矩阵</param> public static SinexFile Merge(SinexFile fileA, SinexFile fileB, bool eraseNonCoord = true) { if (eraseNonCoord) { fileA.CleanNonCoordSolutionValue(); fileB.CleanNonCoordSolutionValue(); } SinexFile newFile = EmergeBasic(fileA, fileB); //合并解算结果,不更新标准差 SinexMerger.MergeSolutionValue(newFile.SolutionEstimateBlock, fileA.SolutionEstimateBlock, fileB.SolutionEstimateBlock); SinexMerger.MergeSolutionValue(newFile.SolutionAprioriBlock, fileA.SolutionAprioriBlock, fileB.SolutionAprioriBlock); //统计数据的合并, 需要做一些叠加工作。 SinexStatistic statisticA = fileA.GetStatistic(); SinexStatistic statisticB = fileB.GetStatistic(); if (fileA.SolutionStattisticsBlock != null && fileB.SolutionStattisticsBlock != null) { newFile.SolutionStattisticsBlock.Items = fileA.GetStatistic().Merge(fileB.GetStatistic()).GetSolutionStatistics(); } SinexStatistic statisticNew = newFile.GetStatistic(); double varFactorA = statisticNew.VarianceOfUnitWeight / statisticA.VarianceOfUnitWeight; double varFactorB = statisticNew.VarianceOfUnitWeight / statisticB.VarianceOfUnitWeight; //合并矩阵,协方差矩阵,前面已经判断并重新布置matrix了,此处只管合并。 MergeSolutionMatrix(newFile.SolutionMatrixEstimateCova, fileA.SolutionMatrixEstimateCova, varFactorA, fileB.SolutionMatrixEstimateCova, varFactorB, newFile.SolutionEstimateBlock); MergeSolutionMatrix(newFile.SolutionMatrixAprioriCova, fileA.SolutionMatrixAprioriCova, varFactorA, fileB.SolutionMatrixAprioriCova, varFactorB, newFile.SolutionAprioriBlock); return(newFile); }
public static List <SolutionStatistic> GetSolutionStatistics(SinexStatistic sta) { List <SolutionStatistic> list = new List <SolutionStatistic>(); list.Add(new SolutionStatistic() { Name = StatisticLabel.CODE_MEASUREMENTS_SIGMA, Val = sta.CodeMeasurementsSigma }); list.Add(new SolutionStatistic() { Name = StatisticLabel.NUMBER_OF_DEGREES_OF_FREEDOM, Val = sta.NumberOfDegreesOfFreedom }); list.Add(new SolutionStatistic() { Name = StatisticLabel.NUMBER_OF_OBSERVATIONS, Val = sta.NumberOfObservations }); list.Add(new SolutionStatistic() { Name = StatisticLabel.NUMBER_OF_UNKNOWNS, Val = sta.NumberOfUnknown }); list.Add(new SolutionStatistic() { Name = StatisticLabel.PHASE_MEASUREMENTS_SIGMA, Val = sta.PhaseMeasurementsSigma }); list.Add(new SolutionStatistic() { Name = StatisticLabel.SAMPLING_INTERVAL_SECONDS, Val = sta.SamplingIntervalSeconds }); list.Add(new SolutionStatistic() { Name = StatisticLabel.SQUARE_SUM_OF_RESIDUALS_VTPV, Val = sta.SquareSumOfResidualsVTPV }); list.Add(new SolutionStatistic() { Name = StatisticLabel.VARIANCE_FACTOR, Val = sta.VarianceOfUnitWeight }); list.Add(new SolutionStatistic() { Name = StatisticLabel.WEIGHTED_SQUARE_SUM_OF_O_C, Val = sta.WeightedSqureSumOfOMinusC }); return(list); }
/// <summary> /// 获取统计信息 /// </summary> /// <returns>文件统计信息</returns> public SinexStatistic GetStatistic() { SinexStatistic sta = new SinexStatistic(); if (SolutionStattisticsBlock == null) { return(sta); } foreach (var item in SolutionStattisticsBlock.Items) { if (item.Name.Contains(StatisticLabel.CODE_MEASUREMENTS_SIGMA)) { sta.CodeMeasurementsSigma = item.Val; } if (item.Name.Contains(StatisticLabel.NUMBER_OF_DEGREES_OF_FREEDOM)) { sta.NumberOfDegreesOfFreedom = item.Val; } if (item.Name.Contains(StatisticLabel.NUMBER_OF_OBSERVATIONS)) { sta.NumberOfObservations = item.Val; } if (item.Name.Contains(StatisticLabel.NUMBER_OF_UNKNOWNS)) { sta.NumberOfUnknown = item.Val; } if (item.Name.Contains(StatisticLabel.PHASE_MEASUREMENTS_SIGMA)) { sta.PhaseMeasurementsSigma = item.Val; } if (item.Name.Contains(StatisticLabel.SAMPLING_INTERVAL_SECONDS)) { sta.SamplingIntervalSeconds = item.Val; } if (item.Name.Contains(StatisticLabel.SQUARE_SUM_OF_RESIDUALS_VTPV)) { sta.SquareSumOfResidualsVTPV = item.Val; } if (item.Name.Contains(StatisticLabel.VARIANCE_FACTOR)) { sta.VarianceOfUnitWeight = item.Val; } if (item.Name.Contains(StatisticLabel.WEIGHTED_SQUARE_SUM_OF_O_C)) { sta.WeightedSqureSumOfOMinusC = item.Val; } } return(sta); }
/// <summary> /// 合并两个统计信息产生一个新的。 /// 本方法假定两文件观测内容不重复,且独立不相关。 /// 单位权方差 = (单位权方差A * 自由度A + 单位权方差B * 自由度B)/(自由度A + 自由度B) /// </summary> /// <param name="one"></param> /// <param name="other"></param> /// <returns></returns> public static SinexStatistic Merge(SinexStatistic one, SinexStatistic other) { return(new SinexStatistic() { NumberOfObservations = one.NumberOfObservations + other.NumberOfObservations, NumberOfUnknown = one.NumberOfUnknown + other.NumberOfUnknown, NumberOfDegreesOfFreedom = one.NumberOfDegreesOfFreedom + other.NumberOfDegreesOfFreedom, VarianceOfUnitWeight = (one.VarianceOfUnitWeight * one.NumberOfDegreesOfFreedom + other.VarianceOfUnitWeight * other.NumberOfDegreesOfFreedom) / (one.NumberOfDegreesOfFreedom + other.NumberOfDegreesOfFreedom), //以下处理方式尚未明确正确与否 CodeMeasurementsSigma = one.CodeMeasurementsSigma, WeightedSqureSumOfOMinusC = one.WeightedSqureSumOfOMinusC, PhaseMeasurementsSigma = one.PhaseMeasurementsSigma, SamplingIntervalSeconds = one.SamplingIntervalSeconds, SquareSumOfResidualsVTPV = one.SquareSumOfResidualsVTPV, //PhaseMeasurementsSigma = // (one.PhaseMeasurementsSigma * one.NumberOfDegreesOfFreedom // + other.PhaseMeasurementsSigma * other.NumberOfDegreesOfFreedom) // / (one.NumberOfDegreesOfFreedom + other.NumberOfDegreesOfFreedom), }); }
/// <summary> /// 合并两个统计信息产生一个新的。 /// 本方法假定两文件观测内容不重复,且独立不相关。 /// </summary> /// <param name="other"></param> public SinexStatistic Merge(SinexStatistic other) { return(Merge(this, other)); }