Ejemplo n.º 1
0
    def test_vcv_cart2local_and_vcv_local2cart2_2X3(self):
        lat = 0.0
        lon = 0.0
        v_cart = np.array([
            [0.0, 0.0, 0.0],
            [0.0, 0.0, 0.0],
        ])

        with self.assertRaises(SystemExit):
            statistics.vcv_cart2local(v_cart, lat, lon)

        with self.assertRaises(SystemExit):
            statistics.vcv_local2cart(v_cart, lat, lon)
Ejemplo n.º 2
0
def mga2020_to_mga94(zone, east, north, ell_ht=False, vcv=None):
    """
    Performs conformal transformation of Map Grid of Australia 2020 to Map Grid of Australia 1994 Coordinates
    using the reverse form of the GDA2020 Tech Manual v1.2 7 parameter similarity transformation parameters
    :param zone: Zone Number - 1 to 60
    :param east: Easting (m, within 3330km of Central Meridian)
    :param north: Northing (m, 0 to 10,000,000m)
    :param ell_ht: Ellipsoid Height (m) (optional)
    :param vcv: Optional 3*3 numpy array in local enu units to propagate tf uncertainty
    :return: MGA1994 Zone, Easting, Northing, Ellipsoid Height (if none provided, returns 0), and vcv matrix
    """
    lat, lon, psf, gridconv = grid2geo(zone, east, north)
    if ell_ht is False:
        ell_ht_in = 0
    else:
        ell_ht_in = ell_ht
    if vcv is not None:
        vcv = vcv_local2cart(vcv, lat, lon)
    x94, y94, z94 = llh2xyz(lat, lon, ell_ht_in)
    x20, y20, z20, vcv94 = conform7(x94, y94, z94, -gda94_to_gda2020, vcv=vcv)
    lat, lon, ell_ht_out = xyz2llh(x20, y20, z20)
    if vcv94 is not None:
        vcv94 = vcv_cart2local(vcv94, lat, lon)
    if ell_ht is False:
        ell_ht_out = 0
    hemisphere, zone20, east20, north20, psf, gridconv = geo2grid(lat, lon)
    return zone20, east20, north20, round(ell_ht_out, 4), vcv94
Ejemplo n.º 3
0
    def test_vcv_local2cart_3X1(self):
        expected_result = np.array([[1.41376457], [1.20291736], [1.22331807]])

        result = statistics.vcv_cart2local(var, lat, lon)

        np.testing.assert_almost_equal(expected_result, result)
        self.assertEqual(type(expected_result), type(result))
Ejemplo n.º 4
0
    def test_vcv_cart2local_3x3(self):
        expected_result = np.array([[2.23971834, -1.86955194, 0.3599339],
                                    [-1.86955194, 1.55096504, -0.29615085],
                                    [0.3599339, -0.29615085, 0.06931662]])

        result = statistics.vcv_cart2local(vcv, lat, lon)

        np.testing.assert_almost_equal(expected_result, result)
        self.assertEqual(type(expected_result), type(result))
Ejemplo n.º 5
0
    def test_vcv_cart2local_and_vcv_local2cart2_1X3(self):
        lat = 0.0
        lon = 0.0
        v_cart = np.array([
            [0.0],
            [0.0],
            [0.0],
        ])
        expected_result = np.array([
            [0.0, 0.0, 0.0],
            [0.0, 0.0, 0.0],
            [0.0, 0.0, 0.0],
        ])

        result_cart2local = statistics.vcv_cart2local(v_cart, lat, lon)
        result_local2cart = statistics.vcv_local2cart(v_cart, lat, lon)

        np.testing.assert_array_equal(expected_result, result_cart2local)
        np.testing.assert_array_equal(expected_result, result_local2cart)
        self.assertEqual(type(expected_result), type(result_cart2local))
        self.assertEqual(type(expected_result), type(result_local2cart))
Ejemplo n.º 6
0
                to_lat = hp2dec(stn[m['Second']]['P'])
                to_lng = hp2dec(stn[m['Second']]['L'])

                #Initialise the required matricies
                at_sd = np.zeros([3, 3])
                to_sd = np.zeros([3, 3])
                orig_vcv = np.zeros([3, 3])
                cal_vcv = np.zeros([3, 3])

                orig_vcv[0, 0] = float(m['GPSBaseline']['SigmaXX'])
                orig_vcv[0, 1] = float(m['GPSBaseline']['SigmaXY'])
                orig_vcv[0, 2] = float(m['GPSBaseline']['SigmaXZ'])
                orig_vcv[1, 1] = float(m['GPSBaseline']['SigmaYY'])
                orig_vcv[1, 2] = float(m['GPSBaseline']['SigmaYZ'])
                orig_vcv[2, 2] = float(m['GPSBaseline']['SigmaZZ'])
                orig_enu = vcv_cart2local(orig_vcv, at_lat, at_lng)

                # find and apply the centring error styling of the at and to station
                # transform these from enu to xyz
                if 'FirstStdDevSetupStyle' in m:
                    c = sd_styl[m['FirstStdDevSetupStyle']]['CentringStdDev']
                    v = sd_styl[m['FirstStdDevSetupStyle']]['VtStdDev']
                    at_sd[0, 0] = (c)**2 / float(m['Lscale'])
                    at_sd[1, 1] = (c)**2 / float(m['Pscale'])
                    at_sd[2, 2] = (v)**2 / float(m['Hscale'])
                    at_sd = at_sd / float(m['Vscale'])

                if 'SecondStdDevSetupStyle' in m:
                    c = sd_styl[m['SecondStdDevSetupStyle']]['CentringStdDev']
                    v = sd_styl[m['SecondStdDevSetupStyle']]['VtStdDev']
                    to_sd[0, 0] = (c)**2 / float(m['Lscale'])
Ejemplo n.º 7
0
    def test_vcv_cart2local_3X2(self):
        v_cart = np.zeros((3, 2))

        with self.assertRaises(ValueError):
            statistics.vcv_cart2local(v_cart, 0.0, 0.0)