private void btnCalculate_Click(object sender, EventArgs e) { double sunRA; double sunDec; double sunDistance; AstroUtilities.QuickPlanet(TimeOfMinimumJD, 3, true, out sunRA, out sunDec, out sunDistance); double dDeg = AstroConvert.ToDeclination(tbxDE.Text); double raHours = AstroConvert.ToRightAcsension(tbxRA.Text); double dRad = dDeg * Math.PI / 180.0; double raRad = raHours * 15 * Math.PI / 180.0; double C = 299792458.0; // m/s // HJD = JD - (r/c) * [sin(d) * sin (dSun) + cos(d) * cos (dSun) * cos (a - aSun)] double correction = (sunDistance * 1.4960E11 / C) * (Math.Sin(dRad) * Math.Sin(sunDec) + Math.Cos(dRad) * Math.Cos(sunDec) * Math.Cos(raRad - sunRA)); double hjd = TimeOfMinimumJD - (correction / (3600 * 24)); tbxCorrection.Text = hjd.ToString(); TimeOfMinimumHJD = hjd; TimeCorrectionHJD = -(correction / (3600 * 24)); }
private void btnFindGSVSStar_Click(object sender, EventArgs e) { string userDesig = tbxVarStar.Text.Trim(); EclipsingVariable foundVar = EclipsingVariableCatalogue.Instance.Stars.FirstOrDefault(x => x.Designation.Equals(userDesig, StringComparison.InvariantCultureIgnoreCase) || x.StandardDesignation.Equals(userDesig, StringComparison.InvariantCultureIgnoreCase)); if (foundVar != null) { double ra = foundVar.RA * 15 * Math.PI / 180.0; double de = foundVar.Dec * Math.PI / 180.0; AstroUtilities.ApparentStarPosition(ref ra, ref de, 0, 0, 2000, TimeOfMinimumJD); tbxRA.Text = AstroConvert.ToStringValue(ra * 180 / (Math.PI * 15), "HH MM SS.T"); tbxDE.Text = AstroConvert.ToStringValue(de * 180 / Math.PI, "DD MM SS"); } }
private void frmResults_Load(object sender, EventArgs e) { ILightCurveDataProvider dataProvider = TangraHost.GetLightCurveDataProvider(); if (dataProvider != null) { ITangraDrawingSettings settings = dataProvider.GetTangraDrawingSettings(); Color targetColor = settings.Target1Color; if (TargetId == 0) { targetColor = settings.Target1Color; } else if (TargetId == 1) { targetColor = settings.Target2Color; } else if (TargetId == 2) { targetColor = settings.Target3Color; } else if (TargetId == 3) { targetColor = settings.Target4Color; } m_TargetBrush = new SolidBrush(targetColor); } else { m_TargetBrush = Brushes.DeepSkyBlue; } if (Results.Success) { tbxErrorMessage.Visible = false; picGraph.Visible = true; } else { tbxErrorMessage.Text = Results.ErrorMessage; tbxErrorMessage.Visible = true; picGraph.Visible = false; } // 1E-6 days is a precision of 0.08 sec - good enough for our purposes tbxT0JD.Text = Results.Time_Of_Minimum_JD.ToString("0.000000"); tbxT0UT.Text = AstroUtilities.JDToDateTimeUtc(Results.Time_Of_Minimum_JD).ToString("dd MMM yyyy, HH:mm:ss.fff"); tbxT0Uncertainty.Text = Results.Time_Of_Minimum_Uncertainty.ToString("0.000000"); tbxT0.Text = Results.T0.ToString("0.000000"); tbxTotalObs.Text = Results.NumberObservations.ToString(); tbxIncludedObs.Text = Results.IncludedObservations.ToString() + "%"; tbxUncertaintyInSec.Text = (Results.Time_Of_Minimum_Uncertainty * 86400.0).ToString("0.0"); PlotKweeVanWoerden(); if (PolyResults != null) { tbxT0JD_CF.Text = PolyResults.Time_Of_Minimum_JD.ToString("0.000000"); tbxT0UT_CF.Text = AstroUtilities.JDToDateTimeUtc(PolyResults.Time_Of_Minimum_JD).ToString("dd MMM yyyy, HH:mm:ss.fff"); nudM0.Value = (decimal)PolyResults.M0; nudC.Value = (decimal)PolyResults.C; nudD.Value = (decimal)PolyResults.D; nudG.Value = (decimal)PolyResults.G; PlotPolyFit(); } }
private void frmHJDCalculation_Load(object sender, EventArgs e) { dateTimePicker.Value = AstroUtilities.JDToDateTimeUtc(TimeOfMinimumJD).Date; }