package leigh.astro.app;

import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;
import org.jastronomy.jsofa.JSOFA;
import org.jastronomy.jsofa.JSOFAIllegalParameter;
import org.jastronomy.jsofa.JSOFAInternalError;

public class ConvertExample {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(ConvertExample.class);

    public static void main(String[] args) throws JSOFAInternalError, JSOFAIllegalParameter {
        double rc, dc, pr, pd, px, rv, utc1, utc2, dut1,
                elong, phi, hm, xp, yp, phpa, tc, rh, wl;

        rc = 2.71;
        dc = 0.174;
        pr = 1e-5;
        pd = 5e-6;
        px = 0.1;
        rv = 55.0;
        utc1 = 2456384.5;
        utc2 = 0.969254051;
        dut1 = 0.1550675;
        elong = -0.527800806;
        phi = -1.2345856;
        hm = 2738.0;
        xp = 2.47230737e-7;
        yp = 1.82640464e-6;
        phpa = 731.0;
        tc = 12.8;
        rh = 0.59;
        wl = 0.55;

        JSOFA.ObservedPositionEO localPosition = JSOFA.jauAtco13(rc, dc, pr, pd, px, rv,
                utc1, utc2, dut1, elong, phi, hm, xp, yp,
                phpa, tc, rh, wl);

        logger.info("Conversion: [az rads: {}] [ha rads: {}]", localPosition.op.aob, localPosition.op.rob);
    }
}
