Example #1
0
def eop_pm(dset):
    """Calculate the partial derivative of the polar motion Earth Orientation Parameters

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    column_names = ["xp", "yp"]
    partials = np.zeros((dset.num_obs, 2))

    src_dir = dset.src_dir.unit_vector[:, None, :]
    baseline = (dset.site_pos_2.itrs_pos - dset.site_pos_1.itrs_pos)[:, :, None]

    # x-pole
    partials[:, 0] = -(
        src_dir @ rotation.Q(dset.time) @ rotation.R(dset.time) @ rotation.dW_dxp(dset.time) @ baseline
    )[:, 0, 0]

    # y-pole
    partials[:, 1] = -(
        src_dir @ rotation.Q(dset.time) @ rotation.R(dset.time) @ rotation.dW_dyp(dset.time) @ baseline
    )[:, 0, 0]

    return partials, column_names, "meter per radian"
Example #2
0
    def itrs2gcrs_dot(self):
        """The derivative of ITRS to GCRS transformation matrix for the given times

        Returns:
            Numpy-float array with transformation matrices, shape is (len(self), 3, 3).
        """
        return rotation.Q(self) @ rotation.dR_dut1(self) @ rotation.W(self)
Example #3
0
    def itrs2gcrs(self):
        """The ITRS to GCRS transformation matrix for the given times

        Returns:
            Numpy-float array with transformation matrices, shape is (len(self), 3, 3).
        """
        return rotation.Q(self) @ rotation.R(self) @ rotation.W(self)
Example #4
0
def eop_lod(dset):
    """Calculate the partial derivative of the Earth Orientation Parameter Length of Day

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """

    unit_vector = dset.sat_pos.gcrs.pos.val - dset.site_pos.gcrs.val
    unit_vector = unit_vector / np.linalg.norm(unit_vector)

    # Use only core sites for EOP estimation
    core_sites = config.tech.core_sites.list
    is_core_station = np.in1d(dset.station, core_sites)

    column_name = ["lod"]

    sat_dir = unit_vector[:, None, :]
    dR_dut1 = rotation.dR_dut1(dset.time)

    dt = (dset.time.jd - dset.time.mean.jd)[:, None, None]
    # lod = - ut1_rate * 1 day -> lod_partial = - ut1_rate_partial / 1 day

    pick_relevant_data = np.zeros((dset.num_obs, 3, 3))

    for j in range(0, dset.num_obs):
        if is_core_station[j]:
            pick_relevant_data[j] += np.eye(3)

    partials = (sat_dir @ rotation.Q(dset.time) @ dR_dut1 @ rotation.W(
        dset.time) @ dset.site_pos.trs.val[:, :, None] @ dt)[:, :, 0]

    return partials, column_name, "meter * radians / seconds"
Example #5
0
def eop_pm(dset):
    """Calculate the partial derivative of the polar motion Earth Orientation Parameters

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    # Use only core sites for EOP estimation
    core_sites = config.tech.core_sites.list
    is_core_station = np.in1d(dset.station, core_sites)

    column_names = ["xp", "yp"]
    partials = np.zeros((dset.num_obs, 2))

    unit_vector = dset.sat_pos.gcrs.pos.val - dset.site_pos.gcrs.val
    unit_vector = unit_vector / np.linalg.norm(unit_vector)

    sat_dir = unit_vector[:, None, :]
    pick_relevant_data = np.zeros((dset.num_obs, 3, 3))
    for j in range(0, dset.num_obs):
        if is_core_station[j]:
            pick_relevant_data[j] += np.eye(3)

    # x-pole
    partials[:, 0] = -(
        sat_dir
        @ rotation.Q(dset.time)
        @ rotation.R(dset.time)
        @ rotation.dW_dxp(dset.time)
        @ pick_relevant_data
        @ dset.site_pos.trs.val[:, :, None]
    )[:, 0, 0]

    # y-pole
    partials[:, 1] = -(
        sat_dir
        @ rotation.Q(dset.time)
        @ rotation.R(dset.time)
        @ rotation.dW_dyp(dset.time)
        @ pick_relevant_data
        @ dset.site_pos.trs.val[:, :, None]
    )[:, 0, 0]

    return partials, column_names, "meter per radian"
Example #6
0
def eop_pm_rate(dset):
    """Calculate the partial derivative of the rate of the polar motion Earth Orientation Parameters

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    column_names = ["dxp", "dyp"]
    partials = np.zeros((dset.num_obs, 2))

    time = dset.time
    src_dir = dset.src_dir.unit_vector[:, None, :]
    baseline = (dset.site_pos_2.trs.pos - dset.site_pos_1.trs.pos).mat
    dt = (time.jd - time.mean.jd)[:, None, None]

    # x-pole
    partials[:, 0] = -(src_dir @ rotation.Q(time) @ rotation.R(time) @ rotation.dW_dxp(time) @ baseline @ dt)[:, 0, 0]

    # y-pole
    partials[:, 1] = -(src_dir @ rotation.Q(time) @ rotation.R(time) @ rotation.dW_dyp(time) @ baseline @ dt)[:, 0, 0]

    return partials, column_names, "meter * days / radian"
Example #7
0
def eop_dut1(dset):
    """Calculate the partial derivative of the dUT1 Earth Orientation Parameter

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    column_name = ["dut1"]

    src_dir = dset.src_dir.unit_vector[:, None, :]
    baseline = (dset.site_pos_2.trs.pos - dset.site_pos_1.trs.pos).mat
    dR_dut1 = rotation.dR_dut1(dset.time)
    partials = -(src_dir @ rotation.Q(dset.time) @ dR_dut1 @ rotation.W(
        dset.time) @ baseline)[:, :, 0]

    return partials, column_name, "meter * (radians per second)"
Example #8
0
def eop_dut1_rate(dset):
    """Calculate the partial derivative of the rate of the dUT1 Earth Orientation Parameter

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    column_name = ["ddut1"]

    src_dir = dset.src_dir.unit_vector[:, None, :]
    baseline = (dset.site_pos_2.itrs_pos - dset.site_pos_1.itrs_pos)[:, :, None]
    dR_dut1 = rotation.dR_dut1(dset.time)
    dt = (dset.time.jd - dset.time.mean.jd)[:, None, None]
    partials = -(src_dir @ rotation.Q(dset.time) @ dR_dut1 @ rotation.W(dset.time) @ baseline @ dt)[:, :, 0]

    return partials, column_name, "meter * radians * days / seconds"
Example #9
0
def eop_lod(dset):
    """Calculate the partial derivative of the Earth Orientation Parameter Length of Day

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """
    column_name = ["lod"]

    src_dir = dset.src_dir.unit_vector[:, None, :]
    baseline = (dset.site_pos_2.trs.pos - dset.site_pos_1.trs.pos).mat
    dR_dut1 = rotation.dR_dut1(dset.time)
    dt = (dset.time.jd - dset.time.mean.jd)[:, None, None]
    # lod = - ut1_rate * 1 day -> lod_partial = - ut1_rate_partial / 1 day
    partials = (src_dir @ rotation.Q(dset.time) @ dR_dut1 @ rotation.W(
        dset.time) @ baseline @ dt)[:, :, 0]

    return partials, column_name, "meter * radians / seconds"
Example #10
0
def eop_dut1(dset):
    """Calculate the partial derivative of the dUT1 Earth Orientation Parameter

    Args:
        data:     A Dataset containing model data.

    Returns:
        Tuple: Array of partial derivatives, and list of names of derivatives
    """

    unit_vector = dset.sat_pos.gcrs.pos.val - dset.site_pos.gcrs.val
    unit_vector = unit_vector / np.linalg.norm(unit_vector)

    # Use only core sites for EOP estimation
    core_sites = config.tech.core_sites.list
    is_core_station = np.in1d(dset.station, core_sites)

    column_name = ["dut1"]

    partials = np.zeros(dset.num_obs)

    sat_dir = unit_vector[:, None, :]
    dR_dut1 = rotation.dR_dut1(dset.time)

    pick_relevant_data = np.zeros((dset.num_obs, 3, 3))

    for j in range(0, dset.num_obs):
        if is_core_station[j]:
            pick_relevant_data[j] += np.eye(3)

    partials = (
        sat_dir
        @ rotation.Q(dset.time)
        @ dR_dut1
        @ rotation.W(dset.time)
        @ pick_relevant_data
        @ dset.site_pos.trs.val[:, :, None]
    )[:, :, 0]

    return partials, column_name, "meter * (radians per second)"