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)); }
private void GetStkCdmTleTCA() { IAgCrdnVector diff = StateCompare.GetVectorBetweenObjects(StkCdmSatellitePath, StkCdmSatellitePath, StkTleSatellitePath); object[] diffMin = StateCompare.GetTimeOfMinAndValue(diff); _stkTimeOfMinRange = (string)diffMin.GetValue(0); _stkMinimumRange = ((double)diffMin.GetValue(1)); }
private void GetStkTCA() { IAgCrdnVector diff = StateCompare.GetVectorBetweenObjects("*/Satellite/" + Primary.StkCdmSatelliteName, "*/Satellite/" + Primary.StkCdmSatelliteName, "*/Satellite/" + Secondary.StkCdmSatelliteName); object[] diffMin = StateCompare.GetTimeOfMinAndValue(diff); _stkTimeOfMinRange = (string)diffMin.GetValue(0); _stkMinimumRange = ((double)diffMin.GetValue(1)); }
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); } }
public static object[] GetTcaRangeInfo(string sat1Path, string sat2Path) { IAgCrdnVector diff = StateCompare.GetVectorBetweenObjects(sat1Path, sat1Path, sat2Path); object[] diffMin = StateCompare.GetTimeOfMinAndValue(diff); string stkTimeOfMinRange = (string)diffMin.GetValue(0); double stkMinimumRange = ((double)diffMin.GetValue(1)); return(new object[] { stkTimeOfMinRange, stkMinimumRange }); }
public string[] SummaryOfConjunctionsFromSecondaryStates() { bool tlePSuccess = this.Primary.StkTleSatellitePath != null; bool cdmPSuccess = this.Primary.StkCdmSatellitePath != null; bool ephPSuccess = this.Primary.StkEphSatellitePath != null; string primary = ephPSuccess ? this.Primary.StkEphSatellitePath : cdmPSuccess ? this.Primary.StkCdmSatellitePath : this.Primary.StkTleSatellitePath; bool tleSSuccess = this.Secondary.StkTleSatellitePath != null; bool cdmSSuccess = this.Secondary.StkCdmSatellitePath != null; bool ephSSuccess = this.Secondary.StkEphSatellitePath != null; List <string> secondaries = new List <string>(); if (ephSSuccess) { secondaries.Add(this.Secondary.StkEphSatellitePath); } if (tleSSuccess) { secondaries.Add(this.Secondary.StkTleSatellitePath); } if (cdmSSuccess) { secondaries.Add(this.Secondary.StkCdmSatellitePath); } string primaryType = primary.Equals(this.Primary.StkEphSatellitePath) ? "Ephemeris" : primary.Equals(this.Primary.StkTleSatellitePath) ? "TLE" : primary.Equals(this.Primary.StkCdmSatellitePath) ? "CDM" : null; List <string> result = new List <string>(); if (primary != null && secondaries.Count > 0) { string[] pplNames = secondaries.Select(s => s.Equals(this.Secondary.StkEphSatellitePath) ? "Ephemeris" : s.Equals(this.Secondary.StkTleSatellitePath) ? "TLE" : s.Equals(this.Secondary.StkCdmSatellitePath) ? "CDM" : null).ToArray(); for (int i = 0; i < secondaries.Count; i++) { string second = secondaries[i]; object[] primaryToSecondary = StateCompare.GetTcaRangeInfo(primary, second); result.Add("Primary " + primaryType + " to Secondary " + pplNames[i] + " = TCA " + primaryToSecondary[0].ToString() + " : Range (m) " + ((double)primaryToSecondary[1]).ToString("0.##")); } return(result.ToArray()); } return(null); }
public GraphPane GraphConjunction(Graphics g) { StateCompare.RICResults ricOverTime = StateCompare.GetRICDifferenceOverTime("*/Satellite/" + this.Primary.StkCdmSatelliteName, "*/Satellite/" + this.Secondary.StkCdmSatelliteName, this.TCA); TextObj tcaComment = ZedGraphAssistant.CreateGraphLabel("TCA : " + this.TCA, .01f, .01f, Color.Black); TextObj missComment = ZedGraphAssistant.CreateGraphLabel("CDM Range at TCA (m): " + this.MissDistance.ToString("0.##"), .01f, .05f, Color.Black); TextObj createTimeComment = ZedGraphAssistant.CreateGraphLabel("CDM Creation Time: " + this.CreationDate, 1f, .01f, AlignH.Right, AlignV.Top, Color.Black); TextObj cdmIDComment = ZedGraphAssistant.CreateGraphLabel("CDM ID: " + this.ID, 1f, .05f, AlignH.Right, AlignV.Top, Color.Black); 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" }; TextObj[] comments = new TextObj[] { tcaComment, missComment, createTimeComment, cdmIDComment }; return(ZedGraphAssistant.CreateGraph("Conjunction : " + Primary.SatName + " & " + Secondary.SatName, TCA, g, ppl, pplNames, comments)); }
public GraphPane GraphCdmVsTle(Graphics g) { try { if (StkTleSatellitePath == null) { CreateTleSatellite(); } if (StkTleSatellitePath != null) { TextObj stktcaComment = ZedGraphAssistant.CreateGraphLabel("Time of Min Range: " + StkCdmTleTimeOfMinRange, .01f, .01f, Color.Black); TextObj stkmissComment = ZedGraphAssistant.CreateGraphLabel("Minimum Range: " + StkCdmTleMinimumRange.ToString(), .01f, .05f, Color.Black); TextObj tcaComment = ZedGraphAssistant.CreateGraphLabel("TCA : " + this.EpochISOYMD, 1f, .01f, AlignH.Right, AlignV.Top, Color.Black); TextObj tcaRangeComment = ZedGraphAssistant.CreateGraphLabel("Range at TCA : " + StkCdmTleDiffAtCdmTca.ToString(), 1f, .05f, AlignH.Right, AlignV.Top, Color.Black); TextObj[] comments = new TextObj[] { stktcaComment, stkmissComment, tcaComment, tcaRangeComment }; StateCompare.RICResults ricOverTime = StateCompare.GetRICDifferenceOverTime(this.StkCdmSatellitePath, this.StkTleSatellitePath, this.EpochISOYMD); 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 pplTimeOfMinRange = new PointPairList(); pplTimeOfMinRange.Add(StkAssistant.ParseISOYMD(StkCdmTleTimeOfMinRange).ToOADate(), -5 * StkCdmTleMinimumRange); pplTimeOfMinRange.Add(StkAssistant.ParseISOYMD(StkCdmTleTimeOfMinRange).ToOADate(), 5 * StkCdmTleMinimumRange); PointPairList[] ppl = new PointPairList[] { pplR, pplI, pplC, pplRange, pplTimeOfMinRange }; string[] pplNames = new string[] { "Radial", "In-Track", "Cross-Track", "Range", "" }; return(ZedGraphAssistant.CreateGraph("Comparison: " + SatName + " CDM to TLE", this.EpochISOYMD, g, ppl, pplNames, comments)); } return(null); } catch { return(null); } }
public string[] SummaryOfCdmTleComparison() { if (Primary.StkTleSatellitePath != null && Primary.StkCdmSatellitePath != null && Secondary.StkCdmSatellitePath != null && Secondary.StkTleSatellitePath != null) { object[] cdmCdmtca = StateCompare.GetTcaRangeInfo(this.Primary.StkCdmSatellitePath, this.Secondary.StkCdmSatellitePath); object[] cdmTletca = StateCompare.GetTcaRangeInfo(this.Primary.StkCdmSatellitePath, this.Secondary.StkTleSatellitePath); object[] tleCdmtca = StateCompare.GetTcaRangeInfo(this.Primary.StkTleSatellitePath, this.Secondary.StkCdmSatellitePath); object[] tleTletca = StateCompare.GetTcaRangeInfo(this.Primary.StkTleSatellitePath, this.Secondary.StkTleSatellitePath); List <string> result = new List <string>(); result.Add("Primary CDM to Secondary CDM : TCA " + cdmCdmtca[0].ToString() + " - Range (m) " + ((double)cdmCdmtca[1]).ToString("0.##")); result.Add("Primary CDM to Secondary TLE : TCA " + cdmTletca[0].ToString() + " - Range (m) " + ((double)cdmTletca[1]).ToString("0.##")); result.Add("Primary TLE to Secondary CDM : TCA " + tleCdmtca[0].ToString() + " - Range (m) " + ((double)tleCdmtca[1]).ToString("0.##")); result.Add("Primary TLE to Secondary TLE : TCA " + tleTletca[0].ToString() + " - Range (m) " + ((double)tleTletca[1]).ToString("0.##")); return(result.ToArray()); } return(null); }