Exemplo n.º 1
0
    private void ReducePath(PolygonPath polyPath, ReductionSettings settings, ReductionSettings toughestSettings = null)
    {
        if (settings.ReduceByMinDistance &&
            (toughestSettings == null || !toughestSettings.ReduceByMinDistance || settings.MinDistance > toughestSettings.MinDistance)
            )
        {
            polyPath.ReduceByMinDistance(settings.MinDistance, settings.MinVertexCount);
        }

        if (settings.ReduceByMinTriangleArea &&
            (toughestSettings == null || !toughestSettings.ReduceByMinTriangleArea || settings.MinTriangleArea > toughestSettings.MinTriangleArea)
            )
        {
            float worldScale    = Common.WorldScale(transform);
            float globalScaleSq = worldScale * worldScale;

            polyPath.ReduceByMinTriangleArea(settings.MinTriangleArea / globalScaleSq, settings.MinVertexCount);
        }

        if (settings.ReduceCodirected &&
            (toughestSettings == null || !toughestSettings.ReduceCodirected || settings.MinAngle > toughestSettings.MinAngle)
            )
        {
            polyPath.ReduceCodirected(settings.MinAngle * Mathf.Deg2Rad, settings.MinVertexCount);
        }
    }
Exemplo n.º 2
0
        private void Recalculate()
        {
            if (m_DataProvider != null && !m_LoadingData)
            {
                WeightingMode mode = WeightingMode.None;
                if (rbWeightingPosAstr.Checked)
                {
                    mode = WeightingMode.SNR;
                }
                else if (rbWeightingAstr.Checked)
                {
                    mode = WeightingMode.SolutionUncertainty;
                }

                var settings = new ReductionSettings()
                {
                    InstrumentalDelaySec              = nudInstDelaySec.Value,
                    Weighting                         = mode,
                    NumberOfChunks                    = (int)nudMeaIntervals.Value,
                    RemoveOutliers                    = cbxOutlierRemoval.Checked,
                    ConstraintPattern                 = cbxContraintPattern.SelectedIndex,
                    BestPositionUncertaintyArcSec     = TangraConfig.Settings.Astrometry.AssumedPositionUncertaintyPixels * (double)nudPixelsPerArcSec.Value,
                    SmallestReportedUncertaintyArcSec = TangraConfig.Settings.Astrometry.SmallestReportedUncertaintyArcSec,
                    FactorInPositionalUncertainty     = cbxFactorInPositionalUncertainty.Checked,
                    ErrorMethod                       = (ErrorMethod)cbxErrorMethod.SelectedIndex,
                    OutliersSigmaThreashold           = (double)nudSigmaExclusion.Value
                };

                m_PositionExtractor.Calculate(
                    m_DataProvider,
                    settings);

                Replot();

                var lines = m_PositionExtractor.ExtractPositions(tbxObsCode.Text, tbxObjectDesign.Text, dtpDate.Value.Date, m_RovingObservatoryProvider);
                tbxMeasurements.Text = string.Join("\r\n", lines);
            }
        }