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"
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)
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"
def eop_nut(dset): """Calculate the partial derivative of the celestial pole offset Earth Orientation Parameters Args: data: A Dataset containing model data. Returns: Tuple: Array of partial derivatives, and list of names of derivatives """ column_names = ["x", "y"] partials = np.zeros((dset.num_obs, 2)) src_dir = dset.src_dir.unit_vector[:, None, :] baseline = (dset.site_pos_2.trs.pos - dset.site_pos_1.trs.pos).mat partials[:, 0] = -(src_dir @ rotation.dQ_dX(dset.time) @ rotation.R( dset.time) @ rotation.W(dset.time) @ baseline)[:, 0, 0] partials[:, 1] = -(src_dir @ rotation.dQ_dY(dset.time) @ rotation.R( dset.time) @ rotation.W(dset.time) @ baseline)[:, 0, 0] return partials, column_names, "meter per radian"
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"