/// <summary> /// Calculate corrected RA/Dec, accounting for atmospheric refraction. /// </summary> /// <remarks> /// NOTE: Valid values for coordinate_type are "TRUE" and "APPARENT". /// </remarks> /// <returns> /// <para>corrected RA hours,minutes,seconds</para> /// <para>corrected Declination degrees,minutes,seconds</para> /// </returns> 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); var altitudeDeg = PAMacros.EquatorialCoordinatesToAltitude(haHour, 0, 0, trueDecDeg, trueDecMin, trueDecSec, geogLatDeg); var correctedAltitudeDeg = PAMacros.Refract(altitudeDeg, coordinateType, atmosphericPressureMbar, atmosphericTemperatureCelsius); var correctedHAHour = PAMacros.HorizonCoordinatesToHourAngle(azimuthDeg, 0, 0, correctedAltitudeDeg, 0, 0, geogLatDeg); var correctedRAHour1 = PAMacros.HourAngleToRightAscension(correctedHAHour, 0, 0, lctHour, lctMin, lctSec, daylightSavingHours, timezoneHours, lcdDay, lcdMonth, lcdYear, geogLongDeg); var correctedDecDeg1 = PAMacros.HorizonCoordinatesToDeclination(azimuthDeg, 0, 0, correctedAltitudeDeg, 0, 0, geogLatDeg); var correctedRAHour = PAMacros.DecimalHoursHour(correctedRAHour1); var correctedRAMin = PAMacros.DecimalHoursMinute(correctedRAHour1); var correctedRASec = PAMacros.DecimalHoursSecond(correctedRAHour1); var correctedDecDeg = PAMacros.DecimalDegreesDegrees(correctedDecDeg1); var correctedDecMin = PAMacros.DecimalDegreesMinutes(correctedDecDeg1); var correctedDecSec = PAMacros.DecimalDegreesSeconds(correctedDecDeg1); return(correctedRAHour, correctedRAMin, correctedRASec, correctedDecDeg, correctedDecMin, correctedDecSec); }