def calc_horizontal(self, date, longitude, latitude): h = GCMath.putIn360( GCEarthData.star_time(date) - self.rektaszension + longitude) self.azimuth = GCMath.rad2deg( math.atan2( GCMath.sinDeg(h), GCMath.cosDeg(h) * GCMath.sinDeg(latitude) - GCMath.tanDeg(self.declination) * GCMath.cosDeg(latitude))) self.elevation = GCMath.rad2deg( math.asin( GCMath.sinDeg(latitude) * GCMath.sinDeg(self.declination) + GCMath.cosDeg(latitude) * GCMath.cosDeg(self.declination) * GCMath.cosDeg(h)))
def equatorialToHorizontalCoords(eqc, obs, date): hc = GCCoords.GCHorizontalCoords() h = GCMath.putIn360( star_time(date) - eqc.rightAscension + obs.longitude_deg) hc.azimut = GCMath.rad2deg( math.atan2( GCMath.sinDeg(h), GCMath.cosDeg(h) * GCMath.sinDeg(obs.latitude_deg) - GCMath.tanDeg(eqc.declination) * GCMath.cosDeg(obs.latitude_deg))) hc.elevation = GCMath.rad2deg( math.asin( GCMath.sinDeg(obs.latitude_deg) * GCMath.sinDeg(eqc.declination) + GCMath.cosDeg(obs.latitude_deg) * GCMath.cosDeg(eqc.declination) * GCMath.cosDeg(h))) return hc