iausathub / satchecker

IAU CPS SatHub tool for satellite position prediction
BSD 3-Clause "New" or "Revised" License
8 stars 1 forks source link

Implement distance, dracosdec, ddec, ddistance for SGP4 #87

Open github-actions[bot] opened 2 months ago

github-actions[bot] commented 2 months ago

https://github.com/iausathub/satchecker/blob/c5a9a3b0fbe274986a361d37c20d86114d8fddba/src/api/utils/propagation_strategies.py#L262


        latitude = observer_location.lat.value
        longitude = observer_location.lon.value
        r_enu = ecef_to_enu(difference, latitude, longitude)

        # Az, Alt, RA, Dec
        az, alt = enu_to_az_el(r_enu)
        ra, dec = az_el_to_ra_dec(az, alt, latitude, longitude, julian_date)

        # Convert ECEF to ITRS
        r_itrs = ecef_to_itrs(r_ecef)

        # Convert ITRS to GCRS
        sat_gcrs = itrs_to_gcrs(r_itrs, julian_date)
        topocentric_gcrs = itrs_to_gcrs(ecef_to_itrs(difference), julian_date)
        topocentric_gcrs_norm = topocentric_gcrs / np.linalg.norm(topocentric_gcrs)

        # phase angle
        phase_angle = get_phase_angle(topocentric_gcrs_norm, sat_gcrs, julian_date)

        illuminated = is_illuminated(sat_gcrs, julian_date)

        # TODO: Implement distance, dracosdec, ddec, ddistance for SGP4
        dracosdec = None
        ddec = None
        distance = None
        ddistance = None

        obs_gcrs = observer_location.get_gcrs_posvel(
            obstime=Time(julian_date, format="jd")
        )
        obs_gcrs = obs_gcrs[0].xyz.value / 1000

        return satellite_position(
            ra,