public void PassPrediction() { List <PassDetails> knownPasses = SetupKnownPasses(); CoordGeodetic geo = new CoordGeodetic(41.760612, -111.819384, 1.394); Tle tle = new Tle("ISS (ZARYA)", "1 25544U 98067A 15090.55997958 .00016867 00000-0 24909-3 0 9997", "2 25544 51.6467 111.8303 0006284 156.4629 341.9393 15.55450652935952"); SGP4 sgp4 = new SGP4(tle); /* * generate 7 day schedule */ DateTime start_date = new DateTime(2015, 4, 13, 0, 0, 0); //DateTime.Now (true); DateTime end_date = start_date.AddDays(7); //new DateTime (System.DateTime.Now.AddDays (7)); List <PassDetails> pass_list = new List <PassDetails>(); ; //Console.WriteLine("Start time: " + start_date.ToString()); //Console.WriteLine("End time : " + end_date.ToString()); /* * generate passes */ pass_list = GeneratePassList(geo, sgp4, start_date, end_date, 180); Assert.AreEqual(knownPasses.Count, pass_list.Count); for (int i = 0; i < pass_list.Count; ++i) { Assert.AreEqual(knownPasses[i].ToString(), pass_list[i].ToString()); } }
public OrbitalElements(Tle tle) { /* * extract and format tle data */ mean_anomoly_ = tle.MeanAnomaly(false); ascending_node_ = tle.RightAscendingNode(false); argument_perigee_ = tle.ArgumentPerigee(false); eccentricity_ = tle.Eccentricity(); inclination_ = tle.Inclination(false); mean_motion_ = tle.MeanMotion() * Global.kTWOPI / Global.kMINUTES_PER_DAY; bstar_ = tle.BStar(); epoch_ = tle.Epoch(); /* * recover original mean motion (xnodp) and semimajor axis (aodp) * from input elements */ double a1 = Math.Pow(Global.kXKE / MeanMotion(), Global.kTWOTHIRD); double cosio = Math.Cos(Inclination()); double theta2 = cosio * cosio; double x3thm1 = 3.0 * theta2 - 1.0; double eosq = Eccentricity() * Eccentricity(); double betao2 = 1.0 - eosq; double betao = Math.Sqrt(betao2); double temp = (1.5 * Global.kCK2) * x3thm1 / (betao * betao2); double del1 = temp / (a1 * a1); double a0 = a1 * (1.0 - del1 * (1.0 / 3.0 + del1 * (1.0 + del1 * 134.0 / 81.0))); double del0 = temp / (a0 * a0); recovered_mean_motion_ = MeanMotion() / (1.0 + del0); /* * alternative way to calculate * doesnt affect final results * recovered_semi_major_axis_ = pow(XKE / RecoveredMeanMotion(), TWOTHIRD); */ recovered_semi_major_axis_ = a0 / (1.0 - del0); /* * find perigee and period */ perigee_ = (RecoveredSemiMajorAxis() * (1.0 - Eccentricity()) - Global.kAE) * Global.kXKMPER; period_ = Global.kTWOPI / RecoveredMeanMotion(); }
/** * Copy constructor * @param[in] tle Tle object to copy from */ public Tle(Tle tle) { name_ = tle.name_; line_one_ = tle.line_one_; line_two_ = tle.line_two_; norad_number_ = tle.norad_number_; int_designator_ = tle.int_designator_; epoch_ = tle.epoch_; mean_motion_dt2_ = tle.mean_motion_dt2_; mean_motion_ddt6_ = tle.mean_motion_ddt6_; bstar_ = tle.bstar_; inclination_ = tle.inclination_; right_ascending_node_ = tle.right_ascending_node_; eccentricity_ = tle.eccentricity_; argument_perigee_ = tle.argument_perigee_; mean_anomaly_ = tle.mean_anomaly_; mean_motion_ = tle.mean_motion_; orbit_number_ = tle.orbit_number_; }