def eclipticalToEquatorialCoords(ecc, date): eqc = GCCoords.GCEquatorialCoords() epsilon = 0.0 delta_phi = 0.0 alpha = delta = 0.0 delta_phi, epsilon = calc_epsilon_phi(date) ecc.longitude = GCMath.putIn360(ecc.longitude + delta_phi) eqc.rightAscension = GCMath.arcTan2Deg( GCMath.sinDeg(ecc.longitude) * GCMath.cosDeg(epsilon) - GCMath.tanDeg(ecc.latitude) * GCMath.sinDeg(epsilon), GCMath.cosDeg(ecc.longitude)) eqc.declination = GCMath.arcSinDeg( GCMath.sinDeg(ecc.latitude) * GCMath.cosDeg(epsilon) + GCMath.cosDeg(ecc.latitude) * GCMath.sinDeg(epsilon) * GCMath.sinDeg(ecc.longitude)) return eqc, ecc
def correct_position(self, jdate, latitude, longitude, height): b_a = 0.99664719 u = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(latitude)) rho_sin = b_a * GCMath.sinDeg(u) + height / 6378140.0 * GCMath.sinDeg( latitude) rho_cos = GCMath.cosDeg( u) + height / 6378140.0 * GCMath.cosDeg(latitude) self.parallax = GCMath.arcSinDeg( GCMath.sinDeg(8.794 / 3600) / (MoonDistance(jdate) / GCMath.AU)) h = GCEarthData.star_time(jdate) - longitude - self.rektaszension delta_alpha = GCMath.arcTanDeg( (-rho_cos * GCMath.sinDeg(self.parallax) * GCMath.sinDeg(h)) / (GCMath.cosDeg(self.declination) - rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h))) self.rektaszension = self.rektaszension + delta_alpha self.declination = GCMath.arcTanDeg( ((GCMath.sinDeg(self.declination) - rho_sin * GCMath.sinDeg(self.parallax)) * GCMath.cosDeg(delta_alpha)) / (GCMath.cosDeg(self.declination) - rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h)))
def getTopocentricEquatorial(self, obs, jdate): b_a = 0.99664719 tec = GCCoords.GCEquatorialCoords() altitude = 0 # geocentric position of observer on the earth surface # 10.1 - 10.3 u = GCMath.arcTanDeg(b_a * b_a * GCMath.tanDeg(obs.latitude_deg)) rho_sin = b_a * GCMath.sinDeg( u) + altitude / 6378140.0 * GCMath.sinDeg(obs.latitude_deg) rho_cos = GCMath.cosDeg(u) + altitude / 6378140.0 * GCMath.cosDeg( obs.latitude_deg) # equatorial horizontal paralax # 39.1 parallax = GCMath.arcSinDeg( GCMath.sinDeg(8.794 / 3600) / (self.radius / GCMath.AU)) # geocentric hour angle of the body h = GCEarthData.star_time( jdate) + obs.longitude_deg - self.rektaszension # 39.2 delta_alpha = GCMath.arcTanDeg( (-rho_cos * GCMath.sinDeg(self.parallax) * GCMath.sinDeg(h)) / (GCMath.cosDeg(self.declination) - rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h))) tec.rightAscension = self.rektaszension + delta_alpha tec.declination = GCMath.arcTanDeg( ((GCMath.sinDeg(self.declination) - rho_sin * GCMath.sinDeg(self.parallax)) * GCMath.cosDeg(delta_alpha)) / (GCMath.cosDeg(self.declination) - rho_cos * GCMath.sinDeg(self.parallax) * GCMath.cosDeg(h))) return tec