diff --git a/PALib.Tests/PACoordinates.cs b/PALib.Tests/PACoordinates.cs index 47e02e5..798995d 100644 --- a/PALib.Tests/PACoordinates.cs +++ b/PALib.Tests/PACoordinates.cs @@ -81,7 +81,7 @@ public void GalacticCoordinateToEquatorialCoordinate() [Fact] public void AngleBetweenTwoObjects() { - Assert.Equal((23, 40, 25.86), _paCoordinates.AngleBetweenTwoObjects(5, 13, 31.7, -8, 13, 30, 6, 44, 13.4, -16, 41, 11, "H")); + Assert.Equal((23, 40, 25.86), _paCoordinates.AngleBetweenTwoObjects(5, 13, 31.7, -8, 13, 30, 6, 44, 13.4, -16, 41, 11, PAAngleMeasure.Hours)); } [Fact] @@ -113,13 +113,13 @@ public void CorrectForAberration() [Fact] public void AtmosphericRefraction() { - Assert.Equal((23, 13, 44.74, 40, 19, 45.76), _paCoordinates.AtmosphericRefraction(23, 14, 0, 40, 10, 0, "TRUE", 0.17, 51.2036110, 0, 0, 23, 3, 1987, 1, 1, 24, 1012, 21.7)); + Assert.Equal((23, 13, 44.74, 40, 19, 45.76), _paCoordinates.AtmosphericRefraction(23, 14, 0, 40, 10, 0, PACoordinateType.True, 0.17, 51.2036110, 0, 0, 23, 3, 1987, 1, 1, 24, 1012, 21.7)); } [Fact] public void CorrectionsForGeocentricParallax() { - var result = _paCoordinates.CorrectionsForGeocentricParallax(22, 35, 19, -7, 41, 13, "TRUE", 1.019167, -100, 50, 60, 0, -6, 26, 2, 1979, 10, 45, 0); + var result = _paCoordinates.CorrectionsForGeocentricParallax(22, 35, 19, -7, 41, 13, PACoordinateType.True, 1.019167, -100, 50, 60, 0, -6, 26, 2, 1979, 10, 45, 0); Assert.Equal((22, 36, 43.22, -8, 32, 17.4), result); } diff --git a/PALib.Tests/PADateTime.cs b/PALib.Tests/PADateTime.cs index 9512568..7afbaf1 100644 --- a/PALib.Tests/PADateTime.cs +++ b/PALib.Tests/PADateTime.cs @@ -62,7 +62,7 @@ public void UniversalTimeToGreenwichSiderealTime() [Fact] public void GreenwichSiderealTimeToUniversalTime() { - Assert.Equal((14, 36, 51.67, "OK"), _paDateTime.GreenwichSiderealTimeToUniversalTime(4, 40, 5.23, 22, 4, 1980)); + Assert.Equal((14, 36, 51.67, PAWarningFlag.OK), _paDateTime.GreenwichSiderealTimeToUniversalTime(4, 40, 5.23, 22, 4, 1980)); } [Fact] diff --git a/PALib/PABinary.cs b/PALib/PABinary.cs index ac0c199..12b4a93 100644 --- a/PALib/PABinary.cs +++ b/PALib/PABinary.cs @@ -9,11 +9,6 @@ public class PABinary /// /// Calculate orbital data for binary star. /// - /// - /// - /// - /// - /// /// /// positionAngleDeg -- Position angle (degrees) /// separationArcsec -- Separation of binary members (arcseconds) diff --git a/PALib/PAComet.cs b/PALib/PAComet.cs index 40ced7e..e65d8e0 100644 --- a/PALib/PAComet.cs +++ b/PALib/PAComet.cs @@ -9,15 +9,6 @@ public class PAComet /// /// Calculate position of an elliptical comet. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// cometRAHour -- Right ascension of comet (hour part) /// cometRAMin -- Right ascension of comet (minutes part) @@ -76,15 +67,6 @@ public class PAComet /// /// Calculate position of a parabolic comet. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// cometRAHour -- Right ascension of comet (hour part) /// cometRAMin -- Right ascension of comet (minutes part) @@ -103,8 +85,6 @@ public class PAComet var greenwichDateMonth = PAMacros.LocalCivilTimeGreenwichMonth(lctHour, lctMin, lctSec, daylightSaving, zoneCorrectionHours, localDateDay, localDateMonth, localDateYear); var greenwichDateYear = PAMacros.LocalCivilTimeGreenwichYear(lctHour, lctMin, lctSec, daylightSaving, zoneCorrectionHours, localDateDay, localDateMonth, localDateYear); - // var _utHours = PAMacros.LocalCivilTimeToUniversalTime(lctHour, lctMin, lctSec, daylightSaving, zoneCorrectionHours, localDateDay, localDateMonth, localDateYear); - var cometInfo = CometInfoParabolic.GetCometParabolicInfo(cometName); var perihelionEpochDay = cometInfo.EpochPeriDay; @@ -115,7 +95,6 @@ public class PAComet var perihelionDeg = cometInfo.ArgPeri; var nodeDeg = cometInfo.Node; - // let(comet_long_deg, comet_lat_deg, comet_dist_au) = var cometLongLatDist = PAMacros.PCometLongLatDist(lctHour, lctMin, lctSec, daylightSaving, zoneCorrectionHours, localDateDay, localDateMonth, localDateYear, perihelionEpochDay, perihelionEpochMonth, perihelionEpochYear, qAU, inclinationDeg, perihelionDeg, nodeDeg); var cometRAHours = PAMacros.DecimalDegreesToDegreeHours(PAMacros.EcRA(cometLongLatDist.cometLongDeg, 0, 0, cometLongLatDist.cometLatDeg, 0, 0, greenwichDateDay, greenwichDateMonth, greenwichDateYear)); diff --git a/PALib/PACoordinates.cs b/PALib/PACoordinates.cs index 9410f91..8b3f636 100644 --- a/PALib/PACoordinates.cs +++ b/PALib/PACoordinates.cs @@ -8,9 +8,6 @@ public class PACoordinates /// /// Convert an Angle (degrees, minutes, and seconds) to Decimal Degrees /// - /// - /// - /// /// Decimal Degrees (double) public double AngleToDecimalDegrees(double degrees, double minutes, double seconds) { @@ -25,9 +22,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Convert Decimal Degrees to an Angle (degrees, minutes, and seconds) /// - /// - /// - /// /// Tuple (degrees, minutes, seconds) public (double degrees, double minutes, double seconds) DecimalDegreesToAngle(double decimalDegrees) { @@ -46,18 +40,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Convert Right Ascension to Hour Angle /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (hourAngleHours, hourAngleMinutes, hourAngleSeconds) public (double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds) RightAscensionToHourAngle(double raHours, double raMinutes, double raSeconds, double lctHours, double lctMinutes, double lctSeconds, bool isDaylightSavings, int zoneCorrection, double localDay, int localMonth, int localYear, double geographicalLongitude) { @@ -75,18 +57,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Convert Hour Angle to Right Ascension /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (rightAscensionHours, rightAscensionMinutes, rightAscensionSeconds) public (double raHours, double raMinutes, double raSeconds) HourAngleToRightAscension(double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds, double lctHours, double lctMinutes, double lctSeconds, bool isDaylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear, double geographicalLongitude) { @@ -104,13 +74,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Convert Equatorial Coordinates to Horizon Coordinates /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (azimuthDegrees, azimuthMinutes, azimuthSeconds, altitudeDegrees, altitudeMinutes, altitudeSeconds) public (double azimuthDegrees, double azimuthMinutes, double azimuthSeconds, double altitudeDegrees, double altitudeMinutes, double altitudeSeconds) EquatorialCoordinatesToHorizonCoordinates(double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds, double declinationDegrees, double declinationMinutes, double declinationSeconds, double geographicalLatitude) { @@ -132,13 +95,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Convert Horizon Coordinates to Equatorial Coordinates /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (hourAngleHours, hourAngleMinutes, hourAngleSeconds, declinationDegrees, declinationMinutes, declinationSeconds) public (double hour_angle_hours, double hour_angle_minutes, double hour_angle_seconds, double declination_degrees, double declination_minutes, double declinationseconds) HorizonCoordinatesToEquatorialCoordinates(double azimuthDegrees, double azimuthMinutes, double azimuthSeconds, double altitudeDegrees, double altitudeMinutes, double altitudeSeconds, double geographicalLatitude) { @@ -160,10 +116,6 @@ public double AngleToDecimalDegrees(double degrees, double minutes, double secon /// /// Calculate Mean Obliquity of the Ecliptic for a Greenwich Date /// - /// - /// - /// - /// public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth, int greenwichYear) { var jd = PAMacros.CivilDateToJulianDate(greenwichDay, greenwichMonth, greenwichYear); @@ -178,15 +130,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Convert Ecliptic Coordinates to Equatorial Coordinates /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (outRAHours, outRAMinutes, outRASeconds, outDecDegrees, outDecMinutes, outDecSeconds) public (double outRAHours, double outRAMinutes, double outRASeconds, double outDecDegrees, double outDecMinutes, double outDecSeconds) EclipticCoordinateToEquatorialCoordinate(double eclipticLongitudeDegrees, double eclipticLongitudeMinutes, double eclipticLongitudeSeconds, double eclipticLatitudeDegrees, double eclipticLatitudeMinutes, double eclipticLatitudeSeconds, double greenwichDay, int greenwichMonth, int greenwichYear) { @@ -219,15 +162,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Convert Equatorial Coordinates to Ecliptic Coordinates /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (outEclLongDeg, outEclLongMin, outEclLongSec, outEclLatDeg, outEclLatMin, outEclLatSec) public (double outEclLongDeg, double outEclLongMin, double outEclLongSec, double outEclLatDeg, double outEclLatMin, double outEclLatSec) EquatorialCoordinateToEclipticCoordinate(double raHours, double raMinutes, double raSeconds, double decDegrees, double decMinutes, double decSeconds, double gwDay, int gwMonth, int gwYear) { @@ -259,12 +193,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Convert Equatorial Coordinates to Galactic Coordinates /// - /// - /// - /// - /// - /// - /// /// Tuple (galLongDeg, galLongMin, galLongSec, galLatDeg, galLatMin, galLatSec) public (double galLongDeg, double galLongMin, double galLongSec, double galLatDeg, double galLatMin, double galLatSec) EquatorialCoordinateToGalacticCoordinate(double raHours, double raMinutes, double raSeconds, double decDegrees, double decMinutes, double decSeconds) { @@ -293,12 +221,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Convert Galactic Coordinates to Equatorial Coordinates /// - /// - /// - /// - /// - /// - /// /// Tuple (raHours, raMinutes, raSeconds, decDegrees, decMinutes, decSeconds) public (double raHours, double raMinutes, double raSeconds, double decDegrees, double decMinutes, double decSeconds) GalacticCoordinateToEquatorialCoordinate(double galLongDeg, double galLongMin, double galLongSec, double galLatDeg, double galLatMin, double galLatSec) { @@ -329,31 +251,18 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate the angle between two celestial objects /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (angleDeg, angleMin, angleSec) - public (double angleDeg, double angleMin, double angleSec) AngleBetweenTwoObjects(double raLong1HourDeg, double raLong1Min, double raLong1Sec, double decLat1Deg, double decLat1Min, double decLat1Sec, double raLong2HourDeg, double raLong2Min, double raLong2Sec, double decLat2Deg, double decLat2Min, double decLat2Sec, string hourOrDegree) + public (double angleDeg, double angleMin, double angleSec) AngleBetweenTwoObjects(double raLong1HourDeg, double raLong1Min, double raLong1Sec, double decLat1Deg, double decLat1Min, double decLat1Sec, double raLong2HourDeg, double raLong2Min, double raLong2Sec, double decLat2Deg, double decLat2Min, double decLat2Sec, PAAngleMeasure hourOrDegree) { - var raLong1Decimal = (hourOrDegree.Equals("H")) ? PAMacros.HMStoDH(raLong1HourDeg, raLong1Min, raLong1Sec) : PAMacros.DegreesMinutesSecondsToDecimalDegrees(raLong1HourDeg, raLong1Min, raLong1Sec); - var raLong1Deg = (hourOrDegree.Equals("H")) ? PAMacros.DegreeHoursToDecimalDegrees(raLong1Decimal) : raLong1Decimal; + var raLong1Decimal = (hourOrDegree == PAAngleMeasure.Hours) ? PAMacros.HMStoDH(raLong1HourDeg, raLong1Min, raLong1Sec) : PAMacros.DegreesMinutesSecondsToDecimalDegrees(raLong1HourDeg, raLong1Min, raLong1Sec); + var raLong1Deg = (hourOrDegree == PAAngleMeasure.Hours) ? PAMacros.DegreeHoursToDecimalDegrees(raLong1Decimal) : raLong1Decimal; var raLong1Rad = raLong1Deg.ToRadians(); var decLat1Deg1 = PAMacros.DegreesMinutesSecondsToDecimalDegrees(decLat1Deg, decLat1Min, decLat1Sec); var decLat1Rad = decLat1Deg1.ToRadians(); - var raLong2Decimal = (hourOrDegree.Equals("H")) ? PAMacros.HMStoDH(raLong2HourDeg, raLong2Min, raLong2Sec) : PAMacros.DegreesMinutesSecondsToDecimalDegrees(raLong2HourDeg, raLong2Min, raLong2Sec); - var raLong2Deg = (hourOrDegree.Equals("H")) ? PAMacros.DegreeHoursToDecimalDegrees(raLong2Decimal) : raLong2Decimal; + var raLong2Decimal = (hourOrDegree == PAAngleMeasure.Hours) ? PAMacros.HMStoDH(raLong2HourDeg, raLong2Min, raLong2Sec) : PAMacros.DegreesMinutesSecondsToDecimalDegrees(raLong2HourDeg, raLong2Min, raLong2Sec); + var raLong2Deg = (hourOrDegree == PAAngleMeasure.Hours) ? PAMacros.DegreeHoursToDecimalDegrees(raLong2Decimal) : raLong2Decimal; var raLong2Rad = raLong2Deg.ToRadians(); var decLat2Deg1 = PAMacros.DegreesMinutesSecondsToDecimalDegrees(decLat2Deg, decLat2Min, decLat2Sec); var decLat2Rad = decLat2Deg1.ToRadians(); @@ -373,18 +282,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate rising and setting times for an object. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (riseSetStatus, utRiseHour, utRiseMin, utSetHour, utSetMin, azRise, azSet) public (string riseSetStatus, double utRiseHour, double utRiseMin, double utSetHour, double utSetMin, double azRise, double azSet) RisingAndSetting(double raHours, double raMinutes, double raSeconds, double decDeg, double decMin, double decSec, double gwDateDay, int gwDateMonth, int gwDateYear, double geogLongDeg, double geogLatDeg, double vertShiftDeg) { @@ -423,18 +320,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate precession (corrected coordinates between two epochs) /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (correctedRAHour, correctedRAMinutes, correctedRASeconds, correctedDecDeg, correctedDecMinutes, correctedDecSeconds) public (double correctedRAHour, double correctedRAMinutes, double correctedRASeconds, double correctedDecDeg, double correctedDecMinutes, double correctedDecSeconds) CorrectForPrecession(double raHour, double raMinutes, double raSeconds, double decDeg, double decMinutes, double decSeconds, double epoch1Day, int epoch1Month, int epoch1Year, double epoch2Day, int epoch2Month, int epoch2Year) { @@ -462,9 +347,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate nutation for two values: ecliptic longitude and obliquity, for a Greenwich date. /// - /// - /// - /// /// Tuple (nutation in ecliptic longitude (degrees), nutation in obliquity (degrees)) public (double nutInLongDeg, double nutInOblDeg) NutationInEclipticLongitudeAndObliquity(double greenwichDay, int greenwichMonth, int greenwichYear) { @@ -491,18 +373,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Correct ecliptic coordinates for the effects of aberration. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// apparent ecliptic longitude (degrees, minutes, seconds), /// apparent ecliptic latitude (degrees, minutes, seconds) @@ -534,30 +404,11 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// NOTE: Valid values for coordinate_type are "TRUE" and "APPARENT". /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// - /// corrected RA hours,minutes,seconds, - /// corrected Declination degrees,minutes,seconds + /// corrected RA hours,minutes,seconds + /// corrected Declination degrees,minutes,seconds /// - public (double correctedRAHour, double correctedRAMin, double correctedRASec, double correctedDecDeg, double correctedDecMin, double correctedDecSec) AtmosphericRefraction(double trueRAHour, double trueRAMin, double trueRASec, double trueDecDeg, double trueDecMin, double trueDecSec, string coordinateType, double geogLongDeg, double geogLatDeg, int daylightSavingHours, int timezoneHours, double lcdDay, int lcdMonth, int lcdYear, double lctHour, double lctMin, double lctSec, double atmosphericPressureMbar, double atmosphericTemperatureCelsius) + public (double correctedRAHour, double correctedRAMin, double correctedRASec, double correctedDecDeg, double correctedDecMin, double correctedDecSec) AtmosphericRefraction(double trueRAHour, double trueRAMin, double trueRASec, double trueDecDeg, double trueDecMin, double trueDecSec, PACoordinateType coordinateType, double geogLongDeg, double geogLatDeg, int daylightSavingHours, int timezoneHours, double lcdDay, int lcdMonth, int lcdYear, double lctHour, double lctMin, double lctSec, double atmosphericPressureMbar, double atmosphericTemperatureCelsius) { var haHour = PAMacros.RightAscensionToHourAngle(trueRAHour, trueRAMin, trueRASec, lctHour, lctMin, lctSec, daylightSavingHours, timezoneHours, lcdDay, lcdMonth, lcdYear, geogLongDeg); var azimuthDeg = PAMacros.EquatorialCoordinatesToAzimuth(haHour, 0, 0, trueDecDeg, trueDecMin, trueDecSec, geogLatDeg); @@ -582,30 +433,8 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate corrected RA/Dec, accounting for geocentric parallax. /// - /// - /// NOTE: Valid values for coordinate_type are "TRUE" and "APPARENT". - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// corrected RA hours,minutes,seconds and corrected Declination degrees,minutes,seconds - public (double correctedRAHour, double correctedRAMin, double correctedRASec, double correctedDecDeg, double correctedDecMin, double correctedDecSec) CorrectionsForGeocentricParallax(double raHour, double raMin, double raSec, double decDeg, double decMin, double decSec, string coordinateType, double equatorialHorParallaxDeg, double geogLongDeg, double geogLatDeg, double heightM, int daylightSaving, int timezoneHours, double lcdDay, int lcdMonth, int lcdYear, double lctHour, double lctMin, double lctSec) + public (double correctedRAHour, double correctedRAMin, double correctedRASec, double correctedDecDeg, double correctedDecMin, double correctedDecSec) CorrectionsForGeocentricParallax(double raHour, double raMin, double raSec, double decDeg, double decMin, double decSec, PACoordinateType coordinateType, double equatorialHorParallaxDeg, double geogLongDeg, double geogLatDeg, double heightM, int daylightSaving, int timezoneHours, double lcdDay, int lcdMonth, int lcdYear, double lctHour, double lctMin, double lctSec) { var haHours = PAMacros.RightAscensionToHourAngle(raHour, raMin, raSec, lctHour, lctMin, lctSec, daylightSaving, timezoneHours, lcdDay, lcdMonth, lcdYear, geogLongDeg); @@ -628,11 +457,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate heliographic coordinates for a given Greenwich date, with a given heliographic position angle and heliographic displacement in arc minutes. /// - /// - /// - /// - /// - /// /// heliographic longitude and heliographic latitude, in degrees public (double helioLongDeg, double helioLatDeg) HeliographicCoordinates(double helioPositionAngleDeg, double helioDisplacementArcmin, double gwdateDay, int gwdateMonth, int gwdateYear) { @@ -666,9 +490,6 @@ public double MeanObliquityOfTheEcliptic(double greenwichDay, int greenwichMonth /// /// Calculate carrington rotation number for a Greenwich date /// - /// - /// - /// /// carrington rotation number public int CarringtonRotationNumber(double gwdateDay, int gwdateMonth, int gwdateYear) { @@ -682,9 +503,6 @@ public int CarringtonRotationNumber(double gwdateDay, int gwdateMonth, int gwdat /// /// Calculate selenographic (lunar) coordinates (sub-Earth) /// - /// - /// - /// /// sub-earth longitude, sub-earth latitude, and position angle of pole public (double subEarthLongitude, double subEarthLatitude, double positionAngleOfPole) SelenographicCoordinates1(double gwdateDay, int gwdateMonth, int gwdateYear) { @@ -719,9 +537,6 @@ public int CarringtonRotationNumber(double gwdateDay, int gwdateMonth, int gwdat /// /// Calculate selenographic (lunar) coordinates (sub-Solar) /// - /// - /// - /// /// sub-solar longitude, sub-solar colongitude, and sub-solar latitude public (double subSolarLongitude, double subSolarColongitude, double subSolarLatitude) SelenographicCoordinates2(double gwdateDay, int gwdateMonth, int gwdateYear) { diff --git a/PALib/PADateTime.cs b/PALib/PADateTime.cs index 43e6d2f..2495449 100644 --- a/PALib/PADateTime.cs +++ b/PALib/PADateTime.cs @@ -8,7 +8,6 @@ public class PADateTime /// /// Gets the date of Easter for the year specified. /// - /// /// (Month, Day, Year) public (int Month, int Day, int Year) GetDateOfEaster(int inputYear) { @@ -38,10 +37,6 @@ public class PADateTime /// /// Calculate day number for a date. /// - /// - /// - /// - /// public int CivilDateToDayNumber(int month, int day, int year) { if (month <= 2) @@ -62,10 +57,6 @@ public int CivilDateToDayNumber(int month, int day, int year) /// /// Convert a Civil Time (hours,minutes,seconds) to Decimal Hours /// - /// - /// - /// - /// public double CivilTimeToDecimalHours(double hours, double minutes, double seconds) { return PAMacros.HMStoDH(hours, minutes, seconds); @@ -74,7 +65,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Decimal Hours to Civil Time /// - /// /// Tuple(hours (double), minutes (double), seconds (double)) public (double hours, double minutes, double seconds) DecimalHoursToCivilTime(double decimalHours) { @@ -88,14 +78,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert local Civil Time to Universal Time /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (int utHours, int utMinutes, int utSeconds, int gwDay, int gwMonth, int gwYear) public (int utHours, int utMinutes, int utSeconds, int gwDay, int gwMonth, int gwYear) LocalCivilTimeToUniversalTime(double lctHours, double lctMinutes, double lctSeconds, bool isDaylightSavings, int zoneCorrection, double localDay, int localMonth, int localYear) { @@ -127,14 +109,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Universal Time to local Civil Time /// - /// - /// - /// - /// - /// - /// - /// - /// /// Tuple (int lctHours, int lctMinutes, int lctSeconds, int localDay, int localMonth, int localYear) public (int lctHours, int lctMinutes, int lctSeconds, int localDay, int localMonth, int localYear) UniversalTimeToLocalCivilTime(double utHours, double utMinutes, double utSeconds, bool isDaylightSavings, int zoneCorrection, int gwDay, int gwMonth, int gwYear) { @@ -163,12 +137,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Universal Time to Greenwich Sidereal Time /// - /// - /// - /// - /// - /// - /// /// Tuple (int gstHours, int gstMinutes, double gstSeconds) public (int gstHours, int gstMinutes, double gstSeconds) UniversalTimeToGreenwichSiderealTime(double utHours, double utMinutes, double utSeconds, double gwDay, int gwMonth, int gwYear) { @@ -192,14 +160,8 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Greenwich Sidereal Time to Universal Time /// - /// - /// - /// - /// - /// - /// - /// Tuple (int utHours, int utMinutes, double utSeconds, string warningFlag) - public (int utHours, int utMinutes, double utSeconds, string warningFlag) GreenwichSiderealTimeToUniversalTime(double gstHours, double gstMinutes, double gstSeconds, double gwDay, int gwMonth, int gwYear) + /// Tuple (int utHours, int utMinutes, double utSeconds, PAWarningFlag warningFlag) + public (int utHours, int utMinutes, double utSeconds, PAWarningFlag warningFlag) GreenwichSiderealTimeToUniversalTime(double gstHours, double gstMinutes, double gstSeconds, double gwDay, int gwMonth, int gwYear) { var jd = PAMacros.CivilDateToJulianDate(gwDay, gwMonth, gwYear); var s = jd - 2451545; @@ -215,7 +177,7 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon var utMinutes = PAMacros.DecimalHoursMinute(ut); var utSeconds = PAMacros.DecimalHoursSecond(ut); - var warningFlag = (ut < 0.065574) ? "Warning" : "OK"; + var warningFlag = (ut < 0.065574) ? PAWarningFlag.Warning : PAWarningFlag.OK; return (utHours, utMinutes, utSeconds, warningFlag); } @@ -223,10 +185,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Greenwich Sidereal Time to Local Sidereal Time /// - /// - /// - /// - /// /// Tuple (int lstHours, int lstMinutes, double lstSeconds) public (int lstHours, int lstMinutes, double lstSeconds) GreenwichSiderealTimeToLocalSiderealTime(double gstHours, double gstMinutes, double gstSeconds, double geographicalLongitude) { @@ -245,10 +203,6 @@ public double CivilTimeToDecimalHours(double hours, double minutes, double secon /// /// Convert Local Sidereal Time to Greenwich Sidereal Time /// - /// - /// - /// - /// /// Tuple (int gstHours, int gstMinutes, double gstSeconds) public (int gstHours, int gstMinutes, double gstSeconds) LocalSiderealTimeToGreenwichSiderealTime(double lstHours, double lstMinutes, double lstSeconds, double geographicalLongitude) { diff --git a/PALib/PAEclipses.cs b/PALib/PAEclipses.cs index e0472d7..23c6052 100644 --- a/PALib/PAEclipses.cs +++ b/PALib/PAEclipses.cs @@ -43,11 +43,6 @@ public class PAEclipses /// /// Calculate the circumstances of a lunar eclipse. /// - /// - /// - /// - /// - /// /// /// lunarEclipseCertainDateDay -- Lunar eclipse date (day) /// lunarEclipseCertainDateMonth -- Lunar eclipse date (month) diff --git a/PALib/PAMacros.cs b/PALib/PAMacros.cs index 45f9b70..d31db43 100644 --- a/PALib/PAMacros.cs +++ b/PALib/PAMacros.cs @@ -14,10 +14,6 @@ public static class PAMacros /// /// Original macro name: HMSDH /// - /// - /// - /// - /// public static double HMStoDH(double hours, double minutes, double seconds) { double fHours = hours; @@ -37,8 +33,6 @@ public static double HMStoDH(double hours, double minutes, double seconds) /// /// Original macro name: DHHour /// - /// - /// public static int DecimalHoursHour(double decimalHours) { var a = Math.Abs(decimalHours); @@ -55,8 +49,6 @@ public static int DecimalHoursHour(double decimalHours) /// /// Original macro name: DHMin /// - /// - /// public static int DecimalHoursMinute(double decimalHours) { var a = Math.Abs(decimalHours); @@ -73,8 +65,6 @@ public static int DecimalHoursMinute(double decimalHours) /// /// Original macro name: DHSec /// - /// - /// public static double DecimalHoursSecond(double decimalHours) { var a = Math.Abs(decimalHours); @@ -91,10 +81,6 @@ public static double DecimalHoursSecond(double decimalHours) /// /// Original macro name: CDJD /// - /// - /// - /// - /// public static double CivilDateToJulianDate(double day, double month, double year) { var fDay = (double)day; @@ -142,8 +128,6 @@ public static double CivilDateToJulianDate(double day, double month, double year /// /// Original macro name: JDCDay /// - /// - /// public static double JulianDateDay(double julianDate) { var i = (julianDate + 0.5).Floor(); @@ -164,8 +148,6 @@ public static double JulianDateDay(double julianDate) /// /// Original macro name: JDCMonth /// - /// - /// public static int JulianDateMonth(double julianDate) { var i = (julianDate + 0.5).Floor(); @@ -187,8 +169,6 @@ public static int JulianDateMonth(double julianDate) /// /// Original macro name: JDCYear /// - /// - /// public static int JulianDateYear(double julianDate) { var i = (julianDate + 0.5).Floor(); @@ -211,19 +191,6 @@ public static int JulianDateYear(double julianDate) /// /// Original macro name: RAHA /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double RightAscensionToHourAngle(double raHours, double raMinutes, double raSeconds, double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear, double geographicalLongitude) { var a = LocalCivilTimeToUniversalTime(lctHours, lctMinutes, lctSeconds, daylightSaving, zoneCorrection, localDay, localMonth, localYear); @@ -244,19 +211,6 @@ public static double RightAscensionToHourAngle(double raHours, double raMinutes, /// /// Original macro name: HARA /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double HourAngleToRightAscension(double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds, double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear, double geographicalLongitude) { var a = LocalCivilTimeToUniversalTime(lctHours, lctMinutes, lctSeconds, daylightSaving, zoneCorrection, localDay, localMonth, localYear); @@ -277,15 +231,6 @@ public static double HourAngleToRightAscension(double hourAngleHours, double hou /// /// Original macro name: LctUT /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double LocalCivilTimeToUniversalTime(double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear) { var a = HMStoDH(lctHours, lctMinutes, lctSeconds); @@ -304,15 +249,6 @@ public static double LocalCivilTimeToUniversalTime(double lctHours, double lctMi /// /// Original macro name: UTLct /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double UniversalTimeToLocalCivilTime(double uHours, double uMinutes, double uSeconds, int daylightSaving, int zoneCorrection, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = HMStoDH(uHours, uMinutes, uSeconds); @@ -331,15 +267,6 @@ public static double UniversalTimeToLocalCivilTime(double uHours, double uMinute /// /// Original macro name: UTLcDay /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double UniversalTime_LocalCivilDay(double uHours, double uMinutes, double uSeconds, int daylightSaving, int zoneCorrection, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = HMStoDH(uHours, uMinutes, uSeconds); @@ -358,15 +285,6 @@ public static double UniversalTime_LocalCivilDay(double uHours, double uMinutes, /// /// Original macro name: UTLcMonth /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static int UniversalTime_LocalCivilMonth(double uHours, double uMinutes, double uSeconds, int daylightSaving, int zoneCorrection, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = HMStoDH(uHours, uMinutes, uSeconds); @@ -383,15 +301,6 @@ public static int UniversalTime_LocalCivilMonth(double uHours, double uMinutes, /// /// Original macro name: UTLcYear /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static int UniversalTime_LocalCivilYear(double uHours, double uMinutes, double uSeconds, int daylightSaving, int zoneCorrection, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = HMStoDH(uHours, uMinutes, uSeconds); @@ -408,15 +317,6 @@ public static int UniversalTime_LocalCivilYear(double uHours, double uMinutes, d /// /// Original macro name: LctGDay /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double LocalCivilTimeGreenwichDay(double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear) { var a = HMStoDH(lctHours, lctMinutes, lctSeconds); @@ -434,15 +334,6 @@ public static double LocalCivilTimeGreenwichDay(double lctHours, double lctMinut /// /// Original macro name: LctGMonth /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static int LocalCivilTimeGreenwichMonth(double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear) { var a = HMStoDH(lctHours, lctMinutes, lctSeconds); @@ -459,15 +350,6 @@ public static int LocalCivilTimeGreenwichMonth(double lctHours, double lctMinute /// /// Original macro name: LctGYear /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static int LocalCivilTimeGreenwichYear(double lctHours, double lctMinutes, double lctSeconds, int daylightSaving, int zoneCorrection, double localDay, int localMonth, int localYear) { var a = HMStoDH(lctHours, lctMinutes, lctSeconds); @@ -484,13 +366,6 @@ public static int LocalCivilTimeGreenwichYear(double lctHours, double lctMinutes /// /// Original macro name: UTGST /// - /// - /// - /// - /// - /// - /// - /// public static double UniversalTimeToGreenwichSiderealTime(double uHours, double uMinutes, double uSeconds, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = CivilDateToJulianDate(greenwichDay, greenwichMonth, greenwichYear); @@ -511,11 +386,6 @@ public static double UniversalTimeToGreenwichSiderealTime(double uHours, double /// /// Original macro name: GSTLST /// - /// - /// - /// - /// - /// public static double GreenwichSiderealTimeToLocalSiderealTime(double greenwichHours, double greenwichMinutes, double greenwichSeconds, double geographicalLongitude) { var a = HMStoDH(greenwichHours, greenwichMinutes, greenwichSeconds); @@ -531,14 +401,6 @@ public static double GreenwichSiderealTimeToLocalSiderealTime(double greenwichHo /// /// Original macro name: EQAz /// - /// - /// - /// - /// - /// - /// - /// - /// public static double EquatorialCoordinatesToAzimuth(double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds, double declinationDegrees, double declinationMinutes, double declinationSeconds, double geographicalLatitude) { var a = HMStoDH(hourAngleHours, hourAngleMinutes, hourAngleSeconds); @@ -561,14 +423,6 @@ public static double EquatorialCoordinatesToAzimuth(double hourAngleHours, doubl /// /// Original macro name: EQAlt /// - /// - /// - /// - /// - /// - /// - /// - /// public static double EquatorialCoordinatesToAltitude(double hourAngleHours, double hourAngleMinutes, double hourAngleSeconds, double declinationDegrees, double declinationMinutes, double declinationSeconds, double geographicalLatitude) { var a = HMStoDH(hourAngleHours, hourAngleMinutes, hourAngleSeconds); @@ -588,10 +442,6 @@ public static double EquatorialCoordinatesToAltitude(double hourAngleHours, doub /// /// Original macro name: DMSDD /// - /// - /// - /// - /// public static double DegreesMinutesSecondsToDecimalDegrees(double degrees, double minutes, double seconds) { var a = Math.Abs(seconds) / 60; @@ -607,8 +457,6 @@ public static double DegreesMinutesSecondsToDecimalDegrees(double degrees, doubl /// /// Original macro name: Degrees /// - /// - /// public static double Degrees(double w) { return w * 57.29577951; @@ -620,8 +468,6 @@ public static double Degrees(double w) /// /// Original macro name: DDDeg /// - /// - /// public static double DecimalDegreesDegrees(double decimalDegrees) { var a = Math.Abs(decimalDegrees); @@ -638,8 +484,6 @@ public static double DecimalDegreesDegrees(double decimalDegrees) /// /// Original macro name: DDMin /// - /// - /// public static double DecimalDegreesMinutes(double decimalDegrees) { var a = Math.Abs(decimalDegrees); @@ -656,8 +500,6 @@ public static double DecimalDegreesMinutes(double decimalDegrees) /// /// Original macro name: DDSec /// - /// - /// public static double DecimalDegreesSeconds(double decimalDegrees) { var a = Math.Abs(decimalDegrees); @@ -674,8 +516,6 @@ public static double DecimalDegreesSeconds(double decimalDegrees) /// /// Original macro name: DDDH /// - /// - /// public static double DecimalDegreesToDegreeHours(double decimalDegrees) { return decimalDegrees / 15; @@ -687,8 +527,6 @@ public static double DecimalDegreesToDegreeHours(double decimalDegrees) /// /// Original macro name: DHDD /// - /// - /// public static double DegreeHoursToDecimalDegrees(double degreeHours) { return degreeHours * 15; @@ -700,14 +538,6 @@ public static double DegreeHoursToDecimalDegrees(double degreeHours) /// /// Original macro name: HORDec /// - /// - /// - /// - /// - /// - /// - /// - /// public static double HorizonCoordinatesToDeclination(double azimuthDegrees, double azimuthMinutes, double azimuthSeconds, double altitudeDegrees, double altitudeMinutes, double altitudeSeconds, double geographicalLatitude) { var a = DegreesMinutesSecondsToDecimalDegrees(azimuthDegrees, azimuthMinutes, azimuthSeconds); @@ -726,14 +556,6 @@ public static double HorizonCoordinatesToDeclination(double azimuthDegrees, doub /// /// Original macro name: HORHa /// - /// - /// - /// - /// - /// - /// - /// - /// public static double HorizonCoordinatesToHourAngle(double azimuthDegrees, double azimuthMinutes, double azimuthSeconds, double altitudeDegrees, double altitudeMinutes, double altitudeSeconds, double geographicalLatitude) { var a = DegreesMinutesSecondsToDecimalDegrees(azimuthDegrees, azimuthMinutes, azimuthSeconds); @@ -755,10 +577,6 @@ public static double HorizonCoordinatesToHourAngle(double azimuthDegrees, double /// /// Original macro name: Obliq /// - /// - /// - /// - /// public static double Obliq(double greenwichDay, int greenwichMonth, int greenwichYear) { var a = CivilDateToJulianDate(greenwichDay, greenwichMonth, greenwichYear); @@ -776,10 +594,6 @@ public static double Obliq(double greenwichDay, int greenwichMonth, int greenwic /// /// Original macro name: NutatLong /// - /// - /// - /// - /// public static double NutatLong(double gd, int gm, int gy) { var dj = CivilDateToJulianDate(gd, gm, gy) - 2415020; @@ -835,10 +649,6 @@ public static double NutatLong(double gd, int gm, int gy) /// /// Original macro name: NutatObl /// - /// - /// - /// - /// public static double NutatObl(double greenwichDay, int greenwichMonth, int greenwichYear) { var dj = CivilDateToJulianDate(greenwichDay, greenwichMonth, greenwichYear) - 2415020; @@ -889,11 +699,6 @@ public static double NutatObl(double greenwichDay, int greenwichMonth, int green /// /// Original macro name: LSTGST /// - /// - /// - /// - /// - /// public static double LocalSiderealTimeToGreenwichSiderealTime(double localHours, double localMinutes, double localSeconds, double longitude) { var a = HMStoDH(localHours, localMinutes, localSeconds); @@ -909,13 +714,6 @@ public static double LocalSiderealTimeToGreenwichSiderealTime(double localHours, /// /// Original macro name: GSTUT /// - /// - /// - /// - /// - /// - /// - /// public static double GreenwichSiderealTimeToUniversalTime(double greenwichSiderealHours, double greenwichSiderealMinutes, double greenwichSiderealSeconds, double greenwichDay, int greenwichMonth, int greenwichYear) { var a = CivilDateToJulianDate(greenwichDay, greenwichMonth, greenwichYear); @@ -936,14 +734,7 @@ public static double GreenwichSiderealTimeToUniversalTime(double greenwichSidere /// /// Original macro name: eGSTUT /// - /// - /// - /// - /// - /// - /// - /// - public static string EGstUt(double gsh, double gsm, double gss, double gd, int gm, int gy) + public static PAWarningFlag EGstUt(double gsh, double gsm, double gss, double gd, int gm, int gy) { var a = CivilDateToJulianDate(gd, gm, gy); var b = a - 2451545; @@ -954,7 +745,7 @@ public static string EGstUt(double gsh, double gsm, double gss, double gd, int g var g = f - e; var h = g - (24 * (g / 24).Floor()); - return ((h * 0.9972695663) < (4.0 / 60.0)) ? "Warning" : "OK"; + return ((h * 0.9972695663) < (4.0 / 60.0)) ? PAWarningFlag.Warning : PAWarningFlag.OK; } /// @@ -963,15 +754,6 @@ public static string EGstUt(double gsh, double gsm, double gss, double gd, int g /// /// Original macro name: SunLong /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunLong(double lch, double lcm, double lcs, int ds, int zc, double ld, int lm, int ly) { var aa = LocalCivilTimeGreenwichDay(lch, lcm, lcs, ds, zc, ld, lm, ly); @@ -1034,9 +816,6 @@ public static double SunLong(double lch, double lcm, double lcs, int ds, int zc, /// /// Original macro name: TrueAnomaly /// - /// - /// - /// public static double TrueAnomaly(double am, double ec) { var tp = 6.283185308; @@ -1065,9 +844,6 @@ public static double TrueAnomaly(double am, double ec) /// /// Original macro name: EccentricAnomaly /// - /// - /// - /// public static double EccentricAnomaly(double am, double ec) { var tp = 6.283185308; @@ -1096,16 +872,11 @@ public static double EccentricAnomaly(double am, double ec) /// /// Original macro name: Refract /// - /// - /// - /// - /// - /// - public static double Refract(double y2, string sw, double pr, double tr) + public static double Refract(double y2, PACoordinateType sw, double pr, double tr) { var y = y2.ToRadians(); - var d = (sw.Substring(0, 1).ToLower() == "t") ? -1.0 : 1.0; + var d = (sw == PACoordinateType.True) ? -1.0 : 1.0; if (d == -1) { @@ -1147,11 +918,6 @@ public static double Refract(double y2, string sw, double pr, double tr) /// /// Helper function for Refract /// - /// - /// - /// - /// - /// public static double RefractL3035(double pr, double tr, double y, double d) { if (y < 0.2617994) @@ -1175,18 +941,7 @@ public static double RefractL3035(double pr, double tr, double y, double d) /// /// Original macro name: ParallaxHA /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static double ParallaxHA(double hh, double hm, double hs, double dd, double dm, double ds, string sw, double gp, double ht, double hp) + public static double ParallaxHA(double hh, double hm, double hs, double dd, double dm, double ds, PACoordinateType sw, double gp, double ht, double hp) { var a = gp.ToRadians(); var c1 = a.Cosine(); @@ -1209,7 +964,7 @@ public static double ParallaxHA(double hh, double hm, double hs, double dd, doub var y = (DegreesMinutesSecondsToDecimalDegrees(dd, dm, ds)).ToRadians(); var y1 = y; - var d = (sw.Substring(0, 1).ToLower().Equals("t")) ? 1.0 : -1.0; + var d = (sw.Equals(PACoordinateType.True)) ? 1.0 : -1.0; if (d == 1) { @@ -1250,13 +1005,6 @@ public static double ParallaxHA(double hh, double hm, double hs, double dd, doub /// /// Helper function for parallax_ha /// - /// - /// - /// - /// - /// - /// - /// public static (double p, double q) ParallaxHAL2870(double x, double y, double rc, double rp, double rs, double tp) { var cx = x.Cosine(); @@ -1286,18 +1034,7 @@ public static (double p, double q) ParallaxHAL2870(double x, double y, double rc /// HH,HM,HS,DD,DM,DS,SW,GP,HT,HP /// /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static double ParallaxDec(double hh, double hm, double hs, double dd, double dm, double ds, string sw, double gp, double ht, double hp) + public static double ParallaxDec(double hh, double hm, double hs, double dd, double dm, double ds, PACoordinateType sw, double gp, double ht, double hp) { var a = gp.ToRadians(); var c1 = a.Cosine(); @@ -1321,7 +1058,7 @@ public static double ParallaxDec(double hh, double hm, double hs, double dd, dou var y = (DegreesMinutesSecondsToDecimalDegrees(dd, dm, ds)).ToRadians(); var y1 = y; - var d = (sw.Substring(0, 1).ToLower().Equals("t")) ? 1.0 : -1.0; + var d = (sw.Equals(PACoordinateType.True)) ? 1.0 : -1.0; if (d == 1) { @@ -1361,13 +1098,6 @@ public static double ParallaxDec(double hh, double hm, double hs, double dd, dou /// /// Helper function for parallax_dec /// - /// - /// - /// - /// - /// - /// - /// public static (double p, double q) ParallaxDecL2870(double x, double y, double rc, double rp, double rs, double tp) { var cx = x.Cosine(); @@ -1391,15 +1121,6 @@ public static (double p, double q) ParallaxDecL2870(double x, double y, double r /// /// Original macro name: SunDia /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunDia(double lch, double lcm, double lcs, int ds, int zc, double ld, int lm, int ly) { var a = SunDist(lch, lcm, lcs, ds, zc, ld, lm, ly); @@ -1413,15 +1134,6 @@ public static double SunDia(double lch, double lcm, double lcs, int ds, int zc, /// /// Original macro name: SunDist /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunDist(double lch, double lcm, double lcs, int ds, int zc, double ld, int lm, int ly) { var aa = LocalCivilTimeGreenwichDay(lch, lcm, lcs, ds, zc, ld, lm, ly); @@ -1471,15 +1183,6 @@ public static double SunDist(double lch, double lcm, double lcs, int ds, int zc, /// /// Original macro name: MoonLong /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonLong(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var ut = LocalCivilTimeToUniversalTime(lh, lm, ls, ds, zc, dy, mn, yr); @@ -1574,15 +1277,6 @@ public static double MoonLong(double lh, double lm, double ls, int ds, int zc, d /// /// Original macro name: MoonLat /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonLat(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var ut = LocalCivilTimeToUniversalTime(lh, lm, ls, ds, zc, dy, mn, yr); @@ -1676,15 +1370,6 @@ public static double MoonLat(double lh, double lm, double ls, int ds, int zc, do /// /// Original macro name: MoonHP /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonHP(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var ut = LocalCivilTimeToUniversalTime(lh, lm, ls, ds, zc, dy, mn, yr); @@ -1765,15 +1450,6 @@ public static double MoonHP(double lh, double lm, double ls, int ds, int zc, dou /// /// Original macro name: MoonDist /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonDist(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var hp = (MoonHP(lh, lm, ls, ds, zc, dy, mn, yr)).ToRadians(); @@ -1788,15 +1464,6 @@ public static double MoonDist(double lh, double lm, double ls, int ds, int zc, d /// /// Original macro name: MoonSize /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonSize(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var hp = (MoonHP(lh, lm, ls, ds, zc, dy, mn, yr)).ToRadians(); @@ -1812,8 +1479,6 @@ public static double MoonSize(double lh, double lm, double ls, int ds, int zc, d /// /// Original macro name: Unwind /// - /// - /// public static double Unwind(double w) { return w - 6.283185308 * (w / 6.283185308).Floor(); @@ -1825,7 +1490,6 @@ public static double Unwind(double w) /// /// Original macro name: UnwindDeg /// - /// public static double UnwindDeg(double w) { return w - 360 * (w / 360).Floor(); @@ -1837,10 +1501,6 @@ public static double UnwindDeg(double w) /// /// Original macro name: SunElong /// - /// - /// - /// - /// public static double SunELong(double gd, int gm, int gy) { var t = (CivilDateToJulianDate(gd, gm, gy) - 2415020) / 36525; @@ -1856,10 +1516,6 @@ public static double SunELong(double gd, int gm, int gy) /// /// Original macro name: SunPeri /// - /// - /// - /// - /// public static double SunPeri(double gd, int gm, int gy) { var t = (CivilDateToJulianDate(gd, gm, gy) - 2415020) / 36525; @@ -1875,10 +1531,6 @@ public static double SunPeri(double gd, int gm, int gy) /// /// Original macro name: SunEcc /// - /// - /// - /// - /// public static double SunEcc(double gd, int gm, int gy) { var t = (CivilDateToJulianDate(gd, gm, gy) - 2415020) / 36525; @@ -1893,16 +1545,6 @@ public static double SunEcc(double gd, int gm, int gy) /// /// Original macro name: ECDec /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double EcDec(double eld, double elm, double els, double bd, double bm, double bs, double gd, int gm, int gy) { var a = (DegreesMinutesSecondsToDecimalDegrees(eld, elm, els)).ToRadians(); @@ -1919,16 +1561,6 @@ public static double EcDec(double eld, double elm, double els, double bd, double /// /// Original macro name: ECRA /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double EcRA(double eld, double elm, double els, double bd, double bm, double bs, double gd, int gm, int gy) { var a = (DegreesMinutesSecondsToDecimalDegrees(eld, elm, els)).ToRadians(); @@ -1947,15 +1579,6 @@ public static double EcRA(double eld, double elm, double els, double bd, double /// /// Original macro name: SunTrueAnomaly /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunTrueAnomaly(double lch, double lcm, double lcs, int ds, int zc, double ld, int lm, int ly) { var aa = LocalCivilTimeGreenwichDay(lch, lcm, lcs, ds, zc, ld, lm, ly); @@ -1984,15 +1607,6 @@ public static double SunTrueAnomaly(double lch, double lcm, double lcs, int ds, /// /// Original macro name: SunMeanAnomaly /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunMeanAnomaly(double lch, double lcm, double lcs, int ds, int zc, double ld, int lm, int ly) { var aa = LocalCivilTimeGreenwichDay(lch, lcm, lcs, ds, zc, ld, lm, ly); @@ -2016,14 +1630,6 @@ public static double SunMeanAnomaly(double lch, double lcm, double lcs, int ds, /// /// Original macro name: SunriseLCT /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunriseLCT(double ld, int lm, int ly, int ds, int zc, double gl, double gp) { var di = 0.8333333; @@ -2044,7 +1650,7 @@ public static double SunriseLCT(double ld, int lm, int ly, int ds, int zc, doubl var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { xx = -99.0; } @@ -2072,17 +1678,6 @@ public static double SunriseLCT(double ld, int lm, int ly, int ds, int zc, doubl /// /// Helper function for sunrise_lct() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) SunriseLCTL3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2117,7 +1712,7 @@ public static double SunsetLCT(double ld, int lm, int ly, int ds, int zc, double var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { xx = -99.0; } @@ -2144,12 +1739,6 @@ public static double SunsetLCT(double ld, int lm, int ly, int ds, int zc, double /// /// Helper function for sunset_lct(). /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) SunsetLCTL3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2167,15 +1756,6 @@ public static (double a, double x, double y, double la, string s) SunsetLCTL3710 /// /// Original macro name: RSLSTR /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double RiseSetLocalSiderealTimeRise(double rah, double ram, double ras, double dd, double dm, double ds, double vd, double g) { var a = HMStoDH(rah, ram, ras); @@ -2196,15 +1776,6 @@ public static double RiseSetLocalSiderealTimeRise(double rah, double ram, double /// /// Original macro name: RSLSTS /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double RiseSetLocalSiderealTimeSet(double rah, double ram, double ras, double dd, double dm, double ds, double vd, double g) { var a = HMStoDH(rah, ram, ras); @@ -2225,15 +1796,6 @@ public static double RiseSetLocalSiderealTimeSet(double rah, double ram, double /// /// Original macro name: RSAZR /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double RiseSetAzimuthRise(double rah, double ram, double ras, double dd, double dm, double ds, double vd, double g) { var a = HMStoDH(rah, ram, ras); @@ -2253,15 +1815,6 @@ public static double RiseSetAzimuthRise(double rah, double ram, double ras, doub /// /// Original macro name: RSAZS /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double RiseSetAzimuthSet(double rah, double ram, double ras, double dd, double dm, double ds, double vd, double g) { var a = HMStoDH(rah, ram, ras); @@ -2282,15 +1835,6 @@ public static double RiseSetAzimuthSet(double rah, double ram, double ras, doubl /// Possible values: "OK", "** never rises", "** circumpolar" /// Original macro name: eRS /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static string ERS(double rah, double ram, double ras, double dd, double dm, double ds, double vd, double g) { var a = HMStoDH(rah, ram, ras); @@ -2340,7 +1884,7 @@ public static string ESunRS(double ld, int lm, int ly, int ds, int zc, double gl { x = LocalSiderealTimeToGreenwichSiderealTime(result2.la, 0, 0, gl); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { var s = result2.s + " GST to UT conversion warning"; @@ -2355,17 +1899,6 @@ public static string ESunRS(double ld, int lm, int ly, int ds, int zc, double gl /// /// Helper function for e_sun_rs() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) ESunRS_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2398,7 +1931,7 @@ public static double SunriseAZ(double ld, int lm, int ly, int ds, int zc, double var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { return -99.0; } @@ -2417,17 +1950,6 @@ public static double SunriseAZ(double ld, int lm, int ly, int ds, int zc, double /// /// Helper function for sunrise_az() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) SunriseAZ_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2445,14 +1967,6 @@ public static (double a, double x, double y, double la, string s) SunriseAZ_L371 /// /// Original macro name: SunsetAz /// - /// - /// - /// - /// - /// - /// - /// - /// public static double SunsetAZ(double ld, int lm, int ly, int ds, int zc, double gl, double gp) { var di = 0.8333333; @@ -2471,7 +1985,7 @@ public static double SunsetAZ(double ld, int lm, int ly, int ds, int zc, double var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { return -99.0; } @@ -2490,13 +2004,6 @@ public static double SunsetAZ(double ld, int lm, int ly, int ds, int zc, double /// /// Helper function for sunset_az() /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) SunsetAZ_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2515,15 +2022,6 @@ public static (double a, double x, double y, double la, string s) SunsetAZ_L3710 /// Twilight type (TT) can be one of "C" (civil), "N" (nautical), or "A" (astronomical) /// Original macro name: TwilightAMLCT /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double TwilightAMLCT(double ld, int lm, int ly, int ds, int zc, double gl, double gp, PATwilightType tt) { var di = (double)tt; @@ -2541,7 +2039,7 @@ public static double TwilightAMLCT(double ld, int lm, int ly, int ds, int zc, do var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) return -99.0; sr = SunLong(ut, 0, 0, 0, 0, gd, gm, gy); @@ -2562,17 +2060,6 @@ public static double TwilightAMLCT(double ld, int lm, int ly, int ds, int zc, do /// /// Helper function for twilight_am_lct() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) TwilightAMLCT_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2591,15 +2078,6 @@ public static (double a, double x, double y, double la, string s) TwilightAMLCT_ /// Twilight type can be one of "C" (civil), "N" (nautical), or "A" (astronomical) /// Original macro name: TwilightPMLCT /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double TwilightPMLCT(double ld, int lm, int ly, int ds, int zc, double gl, double gp, PATwilightType tt) { var di = (double)tt; @@ -2617,7 +2095,7 @@ public static double TwilightPMLCT(double ld, int lm, int ly, int ds, int zc, do var x = LocalSiderealTimeToGreenwichSiderealTime(result1.la, 0, 0, gl); var ut = GreenwichSiderealTimeToUniversalTime(x, 0, 0, gd, gm, gy); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) return 0.0; sr = SunLong(ut, 0, 0, 0, 0, gd, gm, gy); @@ -2636,17 +2114,6 @@ public static double TwilightPMLCT(double ld, int lm, int ly, int ds, int zc, do /// /// Helper function for twilight_pm_lct() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) TwilightPMLCT_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2695,7 +2162,7 @@ public static string ETwilight(double ld, int lm, int ly, int ds, int zc, double x = LocalSiderealTimeToGreenwichSiderealTime(result2.la, 0, 0, gl); - if (!EGstUt(x, 0, 0, gd, gm, gy).Equals("OK")) + if (!EGstUt(x, 0, 0, gd, gm, gy).Equals(PAWarningFlag.OK)) { result2.s = $"{result2.s} GST to UT conversion warning"; @@ -2708,13 +2175,6 @@ public static string ETwilight(double ld, int lm, int ly, int ds, int zc, double /// /// Helper function for e_twilight() /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double x, double y, double la, string s) ETwilight_L3710(double gd, int gm, int gy, double sr, double di, double gp) { var a = sr + NutatLong(gd, gm, gy) - 0.005694; @@ -2747,20 +2207,6 @@ public static (double a, double x, double y, double la, string s) ETwilight_L371 /// /// Original macro name: Angle /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double Angle(double xx1, double xm1, double xs1, double dd1, double dm1, double ds1, double xx2, double xm2, double xs2, double dd2, double dm2, double ds2, PAAngleMeasure s ) { @@ -3387,9 +2833,6 @@ public static (double planetLongitude, double planetLatitude, double planetDista /// /// Helper function for planet_long_lat() /// - /// - /// - /// public static (double qa, double qb) PlanetLong_L4685(List pl) { var qa = 0.00204 * (5.0 * pl[2].APValue - 2.0 * pl[1].APValue + 0.21328).Cosine(); @@ -3408,13 +2851,6 @@ public static (double qa, double qb) PlanetLong_L4685(List pl /// /// Helper function for planet_long_lat() /// - /// - /// - /// - /// - /// - /// - /// public static (double qa, double qb, double qc, double qe) PlanetLong_L4735(List pl, double ms, double t) { var qc = 0.00077 * (4.1406 + t * 2.6227).Sine(); @@ -3441,15 +2877,6 @@ public static (double qa, double qb, double qc, double qe) PlanetLong_L4735(List /// /// Helper function for planet_long_lat() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double a, double sa, double ca, double qc, double qe, double qa, double qb) PlanetLong_L4810(List pl, double ms) { var a = 3.0 * pl[4].APValue - 8.0 * pl[3].APValue + 4.0 * ms; @@ -3489,15 +2916,6 @@ public static (double a, double sa, double ca, double qc, double qe, double qa, /// /// Helper function for planet_long_lat() /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static (double qa, double qb, double qc, double qd, double qe, double qf, double qg) PlanetLong_L4945(double t, PlanetDataPrecise planet) { var qa = 0.0; @@ -3765,8 +3183,6 @@ public static (double qa, double qb, double qc, double qd, double qe, double qf, /// /// Original macro name: SolveCubic /// - /// - /// public static double SolveCubic(double w) { var s = w / 3.0; @@ -3875,8 +3291,6 @@ public static (double cometLongDeg, double cometLatDeg, double cometDistAU) PCom /// /// Original macro names: MoonLong, MoonLat, MoonHP /// - /// - /// /// Local civil time, hour part. /// Local civil time, minutes part. /// Local civil time, seconds part. @@ -4038,15 +3452,6 @@ public static (double moonLongDeg, double moonLatDeg, double moonHorPara) MoonLo /// /// Original macro name: MoonPhase /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonPhase(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var moonResult = MoonLongLatHP(lh, lm, ls, ds, zc, dy, mn, yr); @@ -4068,15 +3473,6 @@ public static double MoonPhase(double lh, double lm, double ls, int ds, int zc, /// /// Original macro name: MoonMeanAnomaly /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public static double MoonMeanAnomaly(double lh, double lm, double ls, int ds, int zc, double dy, int mn, int yr) { var ut = LocalCivilTimeToUniversalTime(lh, lm, ls, ds, zc, dy, mn, yr); @@ -4132,7 +3528,6 @@ public static double MoonMeanAnomaly(double lh, double lm, double ls, int ds, in /// Local date, day part. /// Local date, month part. /// Local date, year part. - /// public static double NewMoon(int ds, int zc, double dy, int mn, int yr) { var d0 = LocalCivilTimeGreenwichDay(12.0, 0.0, 0.0, ds, zc, dy, mn, yr); @@ -4166,7 +3561,6 @@ public static double NewMoon(int ds, int zc, double dy, int mn, int yr) /// Local date, day part. /// Local date, month part. /// Local date, year part. - /// public static double FullMoon(int ds, int zc, double dy, int mn, int yr) { var d0 = LocalCivilTimeGreenwichDay(12.0, 0.0, 0.0, ds, zc, dy, mn, yr); @@ -4192,11 +3586,6 @@ public static double FullMoon(int ds, int zc, double dy, int mn, int yr) /// /// Helper function for new_moon() and full_moon() """ /// - /// - /// - /// - /// - /// public static (double a, double b, double f) NewMoonFullMoon_L6855(double k, double t) { var t2 = t * t; @@ -4236,8 +3625,6 @@ public static (double a, double b, double f) NewMoonFullMoon_L6855(double k, dou /// /// Original macro name: FRACT /// - /// - /// public static double Fract(double w) { return w - Lint(w); @@ -4246,8 +3633,6 @@ public static double Fract(double w) /// /// Original macro name: LINT /// - /// - /// public static double Lint(double w) { return IInt(w) + IInt(((1.0 * Sign(w)) - 1.0) / 2.0); @@ -4256,8 +3641,6 @@ public static double Lint(double w) /// /// Original macro name: IINT /// - /// - /// public static double IInt(double w) { return Sign(w) * Math.Abs(w).Floor(); @@ -4339,13 +3722,6 @@ public static double EQELong(double rah, double ram, double ras, double dd, doub /// /// Original macro name: MoonRiseLCT /// - /// - /// - /// - /// - /// - /// - /// /// hours public static double MoonRiseLCT(double dy, int mn, int yr, int ds, int zc, double gLong, double gLat) { @@ -4403,7 +3779,7 @@ public static double MoonRiseLCT(double dy, int mn, int yr, int ds, int zc, doub x = LocalSiderealTimeToGreenwichSiderealTime(la, 0.0, 0.0, gLong); ut = GreenwichSiderealTimeToUniversalTime(x, 0.0, 0.0, gdy, gmn, gyr); - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4418,7 +3794,7 @@ public static double MoonRiseLCT(double dy, int mn, int yr, int ds, int zc, doub /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonRiseLCT_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4523,7 +3899,7 @@ public static (double dy1, int mn1, int yr1) MoonRiseLcDMY(double dy, int mn, in x = LocalSiderealTimeToGreenwichSiderealTime(la, 0.0, 0.0, gLong); ut = GreenwichSiderealTimeToUniversalTime(x, 0.0, 0.0, gdy, gmn, gyr); - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4540,7 +3916,7 @@ public static (double dy1, int mn1, int yr1) MoonRiseLcDMY(double dy, int mn, in /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonRiseLcDMY_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4648,7 +4024,7 @@ public static double MoonRiseAz(double dy, int mn, int yr, int ds, int zc, doubl /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonRiseAz_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4746,7 +4122,7 @@ public static double MoonSetLCT(double dy, int mn, int yr, int ds, int zc, doubl x = LocalSiderealTimeToGreenwichSiderealTime(la, 0.0, 0.0, gLong); ut = GreenwichSiderealTimeToUniversalTime(x, 0.0, 0.0, gdy, gmn, gyr); - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4761,7 +4137,7 @@ public static double MoonSetLCT(double dy, int mn, int yr, int ds, int zc, doubl /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonSetLCT_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4865,7 +4241,7 @@ public static (double dy1, int mn1, int yr1) MoonSetLcDMY(double dy, int mn, int x = LocalSiderealTimeToGreenwichSiderealTime(la, 0.0, 0.0, gLong); ut = GreenwichSiderealTimeToUniversalTime(x, 0.0, 0.0, gdy, gmn, gyr); - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4882,7 +4258,7 @@ public static (double dy1, int mn1, int yr1) MoonSetLcDMY(double dy, int mn, int /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonSetLcDMY_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -4991,7 +4367,7 @@ public static double MoonSetAz(double dy, int mn, int yr, int ds, int zc, double /// public static (double ut, double lct, double dy1, int mn1, int yr1, double gdy, int gmn, int gyr) MoonSetAz_L6680(double x, int ds, int zc, double gdy, int gmn, int gyr, double g1, double ut) { - if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals("OK")) + if (!EGstUt(x, 0.0, 0.0, gdy, gmn, gyr).Equals(PAWarningFlag.OK)) if (Math.Abs(g1 - ut) > 0.5) ut = ut + 23.93447; @@ -5727,12 +5103,6 @@ public static double UTEndTotalLunarEclipse(double dy, int mn, int yr, int ds, i /// /// Original macro name: MagLunarEclipse /// - /// - /// - /// - /// - /// - /// public static double MagLunarEclipse(double dy, int mn, int yr, int ds, int zc) { var tp = 2.0 * Math.PI; @@ -5828,12 +5198,6 @@ public static double MagLunarEclipse(double dy, int mn, int yr, int ds, int zc) /// /// Original macro name: SEOccurrence /// - /// - /// - /// - /// - /// - /// public static string SolarEclipseOccurrence(int ds, int zc, double dy, int mn, int yr) { var d0 = LocalCivilTimeGreenwichDay(12.0, 0.0, 0.0, ds, zc, dy, mn, yr); @@ -6014,8 +5378,8 @@ public static (double paa, double qaa, double xaa, double pbb, double qbb, doubl var paa = EcRA(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var qaa = EcDec(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var xaa = RightAscensionToHourAngle(DecimalDegreesToDegreeHours(paa), 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); - var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); - var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); + var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); + var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); var xbb = HourAngleToRightAscension(pbb, 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); var p = (EQELong(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); var q = (EQELat(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); @@ -6132,8 +5496,8 @@ public static (double paa, double qaa, double xaa, double pbb, double qbb, doubl var paa = EcRA(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var qaa = EcDec(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var xaa = RightAscensionToHourAngle(DecimalDegreesToDegreeHours(paa), 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); - var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); - var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); + var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); + var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); var xbb = HourAngleToRightAscension(pbb, 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); var p = (EQELong(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); var q = (EQELat(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); @@ -6247,8 +5611,8 @@ public static (double paa, double qaa, double xaa, double pbb, double qbb, doubl var paa = EcRA(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var qaa = EcDec(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var xaa = RightAscensionToHourAngle(DecimalDegreesToDegreeHours(paa), 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); - var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); - var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); + var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); + var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); var xbb = HourAngleToRightAscension(pbb, 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); var p = (EQELong(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); var q = (EQELat(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); @@ -6363,8 +5727,8 @@ public static (double paa, double qaa, double xaa, double pbb, double qbb, doubl var paa = EcRA(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var qaa = EcDec(Degrees(x), 0.0, 0.0, Degrees(y), 0.0, 0.0, igday, gmonth, gyear); var xaa = RightAscensionToHourAngle(DecimalDegreesToDegreeHours(paa), 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); - var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); - var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, "true", glat, 0.0, Degrees(hp)); + var pbb = ParallaxHA(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); + var qbb = ParallaxDec(xaa, 0.0, 0.0, qaa, 0.0, 0.0, PACoordinateType.True, glat, 0.0, Degrees(hp)); var xbb = HourAngleToRightAscension(pbb, 0.0, 0.0, tm, 0.0, 0.0, 0, 0, igday, gmonth, gyear, glong); var p = (EQELong(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); var q = (EQELat(xbb, 0.0, 0.0, qbb, 0.0, 0.0, igday, gmonth, gyear)).ToRadians(); diff --git a/PALib/PAMoon.cs b/PALib/PAMoon.cs index 47279a4..f7c2c31 100644 --- a/PALib/PAMoon.cs +++ b/PALib/PAMoon.cs @@ -8,19 +8,6 @@ public class PAMoon /// /// Calculate approximate position of the Moon. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// moon_ra_hour -- Right ascension of Moon (hour part) /// moon_ra_min -- Right ascension of Moon (minutes part) @@ -80,21 +67,6 @@ public class PAMoon /// /// Calculate precise position of the Moon. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// moonRAHour -- Right ascension of Moon (hour part) /// moonRAMin -- Right ascension of Moon (minutes part) @@ -136,16 +108,6 @@ public class PAMoon /// /// Calculate Moon phase and position angle of bright limb. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// moonPhase -- Phase of Moon, between 0 and 1, where 0 is New and 1 is Full. /// paBrightLimbDeg -- Position angle of the bright limb (degrees) @@ -183,11 +145,6 @@ public class PAMoon /// /// Calculate new moon and full moon instances. /// - /// - /// - /// - /// - /// /// /// nmLocalTimeHour -- new Moon instant - local time (hour) /// nmLocalTimeMin -- new Moon instant - local time (minutes) @@ -239,14 +196,6 @@ public class PAMoon /// /// Calculate Moon's distance, angular diameter, and horizontal parallax. /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// earth_moon_dist -- Earth-Moon distance (km) /// ang_diameter_deg -- Angular diameter (degrees part) diff --git a/PALib/PAPlanet.cs b/PALib/PAPlanet.cs index 853f0e3..9f40d06 100644 --- a/PALib/PAPlanet.cs +++ b/PALib/PAPlanet.cs @@ -9,16 +9,6 @@ public class PAPlanet /// /// Calculate approximate position of a planet. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public (double planetRAHour, double planetRAMin, double planetRASec, double planetDecDeg, double planetDecMin, double planetDecSec) ApproximatePositionOfPlanet(double lctHour, double lctMin, double lctSec, bool isDaylightSaving, int zoneCorrectionHours, double localDateDay, int localDateMonth, int localDateYear, string planetName) { var daylightSaving = (isDaylightSaving) ? 1 : 0; @@ -77,16 +67,6 @@ public class PAPlanet /// /// Calculate precise position of a planet. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public (double planetRAHour, double planetRAMin, double planetRASec, double planetDecDeg, double planetDecMin, double planetDecSec) PrecisePositionOfPlanet(double lctHour, double lctMin, double lctSec, bool isDaylightSaving, int zoneCorrectionHours, double localDateDay, int localDateMonth, int localDateYear, string planetName) { var daylightSaving = (isDaylightSaving) ? 1 : 0; @@ -109,15 +89,6 @@ public class PAPlanet /// /// Calculate several visual aspects of a planet. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// distance_au -- Planet's distance from Earth, in AU. /// ang_dia_arcsec -- Angular diameter of the planet. diff --git a/PALib/PASun.cs b/PALib/PASun.cs index 92e5f40..daef6cb 100644 --- a/PALib/PASun.cs +++ b/PALib/PASun.cs @@ -58,15 +58,6 @@ public class PASun /// /// Calculate precise position of the sun for a local date and time. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// public (double sunRAHour, double sunRAMin, double sunRASec, double sunDecDeg, double sunDecMin, double sunDecSec) PrecisePositionOfSun(double lctHours, double lctMinutes, double lctSeconds, double localDay, int localMonth, int localYear, bool isDaylightSaving, int zoneCorrection) { var daylightSaving = (isDaylightSaving == true) ? 1 : 0; @@ -92,14 +83,6 @@ public class PASun /// /// Calculate distance to the Sun (in km), and angular size. /// - /// - /// - /// - /// - /// - /// - /// - /// /// /// sunDistKm -- Sun's distance, in kilometers /// sunAngSizeDeg -- Sun's angular size (degrees part) @@ -131,13 +114,6 @@ public class PASun /// /// Calculate local sunrise and sunset. /// - /// - /// - /// - /// - /// - /// - /// /// /// localSunriseHour -- Local sunrise, hour part /// localSunriseMinute -- Local sunrise, minutes part @@ -247,15 +223,6 @@ public class PASun /// /// Solar elongation is the angle between the lines of sight from the Earth to the Sun and from the Earth to the celestial body. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// /// solarElongationDeg -- Solar elongation, in degrees public double SolarElongation(double raHour, double raMin, double raSec, double decDeg, double decMin, double decSec, double gwdateDay, int gwdateMonth, int gwdateYear) { diff --git a/PALib/PATypes.cs b/PALib/PATypes.cs index 76ad748..bc6c940 100644 --- a/PALib/PATypes.cs +++ b/PALib/PATypes.cs @@ -1,6 +1,12 @@ using System; namespace PALib { + public enum PACoordinateType + { + Apparent, + True + } + /// /// Twilight type /// @@ -28,4 +34,10 @@ public enum PAAccuracyLevel Approximate, Precise } + + public enum PAWarningFlag + { + OK, + Warning + } } \ No newline at end of file diff --git a/PALib/PAUtils.cs b/PALib/PAUtils.cs index 5e72051..5b087f9 100644 --- a/PALib/PAUtils.cs +++ b/PALib/PAUtils.cs @@ -6,8 +6,6 @@ public static class PAUtils /// /// Determine if year is a leap year. /// - /// - /// public static bool IsLeapYear(this int inputYear) { double year = inputYear;