public static GraphPane GenericSatComparisonGraph(Graphics g, string sat1Path, string sat2Path, string centerEpochISOYMD)
        {
            IAgCrdnVector diff = StateCompare.GetVectorBetweenObjects(sat1Path, sat1Path, sat2Path);

            object[] diffMin        = StateCompare.GetTimeOfMinAndValue(diff);
            string   timeOfMinRange = (string)diffMin.GetValue(0);
            double   minRange       = ((double)diffMin.GetValue(1));

            double[] ric        = StateCompare.GetRICDifferenceAtTCA(sat1Path, sat2Path, centerEpochISOYMD);
            double   rangeAtTCA = Math.Sqrt(ric[0] * ric[0] + ric[1] * ric[1] + ric[2] * ric[2]);

            TextObj stktcaComment   = ZedGraphAssistant.CreateGraphLabel("Time of Min Range: " + timeOfMinRange, .01f, .01f, Color.Black);
            TextObj stkmissComment  = ZedGraphAssistant.CreateGraphLabel("Minimum Range: " + minRange.ToString(), .01f, .05f, Color.Black);
            TextObj tcaComment      = ZedGraphAssistant.CreateGraphLabel("Comparison Time : " + centerEpochISOYMD, 1f, .01f, AlignH.Right, AlignV.Top, Color.Black);
            TextObj tcaRangeComment = ZedGraphAssistant.CreateGraphLabel("Range : " + rangeAtTCA.ToString(), 1f, .05f, AlignH.Right, AlignV.Top, Color.Black);

            TextObj[] comments = new TextObj[] { stktcaComment, stkmissComment, tcaComment, tcaRangeComment };

            StateCompare.RICResults ricOverTime = StateCompare.GetRICDifferenceOverTime(sat1Path, sat2Path, centerEpochISOYMD);
            PointPairList           pplR        = ZedGraphAssistant.ArrayToPlottableList(ricOverTime.Times, ricOverTime.R);
            PointPairList           pplI        = ZedGraphAssistant.ArrayToPlottableList(ricOverTime.Times, ricOverTime.I);
            PointPairList           pplC        = ZedGraphAssistant.ArrayToPlottableList(ricOverTime.Times, ricOverTime.C);
            PointPairList           pplRange    = ZedGraphAssistant.ArrayToPlottableList(ricOverTime.Times, ricOverTime.Range);

            PointPairList[] ppl      = new PointPairList[] { pplR, pplI, pplC, pplRange };
            string[]        pplNames = new string[] { "Radial", "In-Track", "Cross-Track", "Range", "" };
            string          sat1Name = sat1Path.Substring(sat1Path.LastIndexOf("/") + 1);
            string          sat2Name = sat2Path.Substring(sat2Path.LastIndexOf("/") + 1);

            return(ZedGraphAssistant.CreateGraph("Comparison: " + sat1Name + " to " + sat2Name, centerEpochISOYMD, g, ppl, pplNames, comments));
        }
예제 #2
0
        public GraphPane GraphSatelliteStateComparison(Graphics g)
        {
            try
            {
                bool tleSuccess = StkTleSatellitePath != null, cdmSuccess = StkCdmSatellitePath != null, ephSuccess = StkEphSatellitePath != null;

                string        primary     = ephSuccess ? StkEphSatellitePath : cdmSuccess ? StkCdmSatellitePath : StkTleSatellitePath;
                List <string> secondaries = new List <string>();
                if (ephSuccess && !primary.Equals(StkEphSatellitePath))
                {
                    secondaries.Add(StkEphSatellitePath);
                }
                if (tleSuccess && !primary.Equals(StkTleSatellitePath))
                {
                    secondaries.Add(StkTleSatellitePath);
                }
                if (cdmSuccess && !primary.Equals(StkCdmSatellitePath))
                {
                    secondaries.Add(StkCdmSatellitePath);
                }

                if (primary != null && secondaries.Count > 0)
                {
                    string[] pplNames = secondaries.Select(s => s.Equals(StkEphSatellitePath) ? "Ephemeris" : s.Equals(StkTleSatellitePath) ? "TLE" : s.Equals(StkCdmSatellitePath) ? "CDM" : null).ToArray();

                    TextObj tcaComment = ZedGraphAssistant.CreateGraphLabel("TCA : " + this.EpochISOYMD, 1f, .01f, AlignH.Right, AlignV.Top, Color.Black);
                    //TextObj[] comments = new TextObj[] {tcaComment, tcaRangeComment };

                    List <PointPairList> ppls     = new List <PointPairList>();
                    List <TextObj>       comments = new List <TextObj>();
                    comments.Add(tcaComment);
                    for (int i = 0; i < secondaries.Count; i++)
                    {
                        string second = secondaries[i];
                        StateCompare.RICResults ricResults = StateCompare.GetRICDifferenceOverTime(primary, second, this.EpochISOYMD);
                        ppls.Add(ZedGraphAssistant.ArrayToPlottableList(ricResults.Times, ricResults.Range));

                        double[] ric        = StateCompare.GetRICDifferenceAtTCA(primary, second, this.EpochISOYMD);
                        double   rangeAtTca = Math.Sqrt(ric[0] * ric[0] + ric[1] * ric[1] + ric[2] * ric[2]);
                        comments.Add(ZedGraphAssistant.CreateGraphLabel(pplNames[i] + " Range at TCA (m): " + rangeAtTca.ToString("0.##"), 1f, (float)(.05 * (i + 1)), AlignH.Right, AlignV.Top, Color.Black));
                    }

                    PointPairList[] ppl         = ppls.ToArray();
                    string          primaryType = primary.Equals(StkEphSatellitePath) ? "Ephemeris" : primary.Equals(StkTleSatellitePath) ? "TLE" : primary.Equals(StkCdmSatellitePath) ? "CDM" : null;
                    GraphPane       graph       = ZedGraphAssistant.CreateGraph(SatName + " State Comparison: Baseline = " + primaryType, this.EpochISOYMD, g, ppl, pplNames, comments.ToArray());
                    graph.XAxis.Scale.Min = 0;

                    return(graph);
                }

                return(null);
            }
            catch
            {
                return(null);
            }
        }