Skip to content

Commit 98a45ae

Browse files
author
Michael Sh
committed
Fixed test for coeffs for 2029.5
1 parent 5a743da commit 98a45ae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

coeffs/read_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ func TestIGRFcoeffs_Coeffs(t *testing.T) {
5959
wantErr: false,
6060
},
6161
{
62-
// name: "2022.5: Coeffs when degrees are not equal (13 > 8)",
6362
name: "2022.5: Coeffs when degrees are equal (13), and coeffs are definitive - 3",
6463
args: args{date: 2022.5},
6564
want1: &[]float64{-29376.705, -1430.835, 4599.425, -2527.99, 2966.43, -3062.66, 1662.775, -774.41, 1361.95, -2392.5, -69.43, 1239.93, 239.7, 489.5, -546.06, 898.76, 804.535, 280.35, 70.99, -146.25, -295.285, 205.875, 29.72, -362.85, -233.66, 366.13, 46.41, 187.53, 214.18, -139.715, -122.165, -146.53, 37.495, 17.44, 102.67, 65.135, 64.68, -18.81, 74.83, 20.91, -118.635, 50.83, -38.48, -62.1, 14.25, 9.93, -62.8, 70.42, 80.07, -76.765, -50.2, -8.515, -15.625, 57.875, 0.68, 15.8, 23.53, 4.4, -4.795, -9.205, -26.145, 12.035, -2.05, 23.38, 10.32, 7.815, -17.495, -13.915, 0.755, 12.165, -21.435, -10.73, 16.09, 13.82, 14.275, 2.16, -16.695, -6.05, 0.33, 3.4, 4.865, 8.18, -24.12, 2.92, 11.57, -0.84, 9.08, -1.82, -4.265, -13.16, -5.75, 1.74, 7.495, 8.71, -0.1, -8.965, -0.32, -12.33, 9.7, -1.57, -6.325, 3.34, 0.045, -0.04, 1.83, 3, -0.93, 5.13, 0.075, -8.81, -0.89, 0.145, 1.69, -4.23, 1.17, -3.615, -2.49, 0.4, -3.87, -8.92, 2.98, -1.38, -0.01, -2.505, 2.65, 2.355, -0.575, -0.725, -0.145, 0.14, 0.56, -0.63, -0.255, -0.085, -1.43, 1.27, -1.65, -0.795, -2.94, 0.04, -1.885, 2.845, -2.405, -2, -0.115, -1.175, 0.415, 0.56, 1.24, 1.185, -1.17, -1.655, 0.655, 0.04, 0.405, 0.655, 0.495, -0.175, -0.18, 0.675, -0.485, 0.13, -0.055, -0.915, -1.165, 0.03, -0.515, 0.36, 0.14, -0.915, -0.89, 0.565, 0.67, 0.71, 1.3, -0.25, -0.34, 0.625, -1.305, 0.045, -0.095, 0.73, 0.245, -0.025, -0.155, 0.335, 0.485, 0.165, 0.57, 0.425, -0.505, -0.48, -0.33, -0.4, -0.55},
@@ -68,11 +67,10 @@ func TestIGRFcoeffs_Coeffs(t *testing.T) {
6867
wantErr: false,
6968
},
7069
{
71-
// FIXME: these coeffs are just incorrect
7270
name: "2029.5: Coeffs for the date just before the end of the last epoch.",
7371
args: args{date: 2029.5},
74-
want1: &[]float64{-29350, -1410.300048828125, 4545.5, -2556.199951171875, 2950.89990234375, -3133.60009765625, 1648.699951171875, -814.2000122070312, 1360.9000244140625, -2404.199951171875, -56.900001525878906, 1243.800048828125, 237.60000610351562, 453.3999938964844, -549.5999755859375, 894.7000122070312, 799.5999755859375, 278.6000061035156, 55.79999923706055, -134, -281.1000061035156, 212, 12, -375.3999938964844, -232.89999389648438, 369, 45.29999923706055, 187.1999969482422, 220, -138.6999969482422, -122.9000015258789, -141.89999389648438, 42.900001525878906, 20.899999618530273, 106.19999694824219, 64.30000305175781, 63.79999923706055, -18.399999618530273, 76.69999694824219, 16.799999237060547, -115.69999694824219, 48.900001525878906, -40.900001525878906, -59.79999923706055, 14.899999618530273, 10.899999618530273, -60.79999923706055, 72.80000305175781, 79.5999984741211, -76.9000015258789, -48.900001525878906, -8.800000190734863, -14.399999618530273, 59.29999923706055, -1, 15.800000190734863, 23.5, 2.5, -7.400000095367432, -11.199999809265137, -25.100000381469727, 14.300000190734863, -2.200000047683716, 23.100000381469727, 10.899999618530273, 7.199999809265137, -17.5, -12.600000381469727, 2, 11.5, -21.799999237060547, -9.699999809265137, 16.899999618530273, 12.699999809265137, 14.899999618530273, 0.699999988079071, -16.799999237060547, -5.199999809265137, 1, 3.9000000953674316, 4.699999809265137, 8, -24.799999237060547, 3, 12.100000381469727, -0.20000000298023224, 8.300000190734863, -2.5, -3.4000000953674316, -13.100000381469727, -5.300000190734863, 2.4000000953674316, 7.199999809265137, 8.600000381469727, -0.6000000238418579, -8.699999809265137, 0.800000011920929, -12.800000190734863, 9.800000190734863, -1.2999999523162842, -6.400000095367432, 3.299999952316284, 0.20000000298023224, 0.10000000149011612, 2, 2.5, -1, 5.400000095367432, -0.5, -9, -0.8999999761581421, 0.4000000059604645, 1.5, -4.199999809265137, 0.8999999761581421, -3.799999952316284, -2.5999999046325684, 0.8999999761581421, -3.9000000953674316, -9, 3, -1.399999976158142, 0, -2.5, 2.799999952316284, 2.4000000953674316, -0.6000000238418579, -0.6000000238418579, 0.10000000149011612, 0, 0.5, -0.6000000238418579, -0.30000001192092896, -0.10000000149011612, -1.2000000476837158, 1.100000023841858, -1.7000000476837158, -1, -2.9000000953674316, -0.10000000149011612, -1.7999999523162842, 2.5999999046325684, -2.299999952316284, -2, -0.10000000149011612, -1.2000000476837158, 0.4000000059604645, 0.6000000238418579, 1.2000000476837158, 1, -1.2000000476837158, -1.5, 0.6000000238418579, 0, 0.5, 0.6000000238418579, 0.5, -0.20000000298023224, -0.10000000149011612, 0.800000011920929, -0.5, 0.10000000149011612, -0.20000000298023224, -0.8999999761581421, -1.2000000476837158, 0.10000000149011612, -0.699999988079071, 0.20000000298023224, 0.20000000298023224, -0.8999999761581421, -0.8999999761581421, 0.6000000238418579, 0.699999988079071, 0.699999988079071, 1.2000000476837158, -0.20000000298023224, -0.30000001192092896, 0.5, -1.2999999523162842, 0.10000000149011612, -0.10000000149011612, 0.699999988079071, 0.20000000298023224, 0, -0.20000000298023224, 0.30000001192092896, 0.5, 0.20000000298023224, 0.6000000238418579, 0.4000000059604645, -0.6000000238418579, -0.5, -0.30000001192092896, -0.4000000059604645, -0.5},
75-
want2: &[]float64{-29350, -1410.300048828125, 4545.5, -2556.199951171875, 2950.89990234375, -3133.60009765625, 1648.699951171875, -814.2000122070312, 1360.9000244140625, -2404.199951171875, -56.900001525878906, 1243.800048828125, 237.60000610351562, 453.3999938964844, -549.5999755859375, 894.7000122070312, 799.5999755859375, 278.6000061035156, 55.79999923706055, -134, -281.1000061035156, 212, 12, -375.3999938964844, -232.89999389648438, 369, 45.29999923706055, 187.1999969482422, 220, -138.6999969482422, -122.9000015258789, -141.89999389648438, 42.900001525878906, 20.899999618530273, 106.19999694824219, 64.30000305175781, 63.79999923706055, -18.399999618530273, 76.69999694824219, 16.799999237060547, -115.69999694824219, 48.900001525878906, -40.900001525878906, -59.79999923706055, 14.899999618530273, 10.899999618530273, -60.79999923706055, 72.80000305175781, 79.5999984741211, -76.9000015258789, -48.900001525878906, -8.800000190734863, -14.399999618530273, 59.29999923706055, -1, 15.800000190734863, 23.5, 2.5, -7.400000095367432, -11.199999809265137, -25.100000381469727, 14.300000190734863, -2.200000047683716, 23.100000381469727, 10.899999618530273, 7.199999809265137, -17.5, -12.600000381469727, 2, 11.5, -21.799999237060547, -9.699999809265137, 16.899999618530273, 12.699999809265137, 14.899999618530273, 0.699999988079071, -16.799999237060547, -5.199999809265137, 1, 3.9000000953674316, 4.699999809265137, 8, -24.799999237060547, 3, 12.100000381469727, -0.20000000298023224, 8.300000190734863, -2.5, -3.4000000953674316, -13.100000381469727, -5.300000190734863, 2.4000000953674316, 7.199999809265137, 8.600000381469727, -0.6000000238418579, -8.699999809265137, 0.800000011920929, -12.800000190734863, 9.800000190734863, -1.2999999523162842, -6.400000095367432, 3.299999952316284, 0.20000000298023224, 0.10000000149011612, 2, 2.5, -1, 5.400000095367432, -0.5, -9, -0.8999999761581421, 0.4000000059604645, 1.5, -4.199999809265137, 0.8999999761581421, -3.799999952316284, -2.5999999046325684, 0.8999999761581421, -3.9000000953674316, -9, 3, -1.399999976158142, 0, -2.5, 2.799999952316284, 2.4000000953674316, -0.6000000238418579, -0.6000000238418579, 0.10000000149011612, 0, 0.5, -0.6000000238418579, -0.30000001192092896, -0.10000000149011612, -1.2000000476837158, 1.100000023841858, -1.7000000476837158, -1, -2.9000000953674316, -0.10000000149011612, -1.7999999523162842, 2.5999999046325684, -2.299999952316284, -2, -0.10000000149011612, -1.2000000476837158, 0.4000000059604645, 0.6000000238418579, 1.2000000476837158, 1, -1.2000000476837158, -1.5, 0.6000000238418579, 0, 0.5, 0.6000000238418579, 0.5, -0.20000000298023224, -0.10000000149011612, 0.800000011920929, -0.5, 0.10000000149011612, -0.20000000298023224, -0.8999999761581421, -1.2000000476837158, 0.10000000149011612, -0.699999988079071, 0.20000000298023224, 0.20000000298023224, -0.8999999761581421, -0.8999999761581421, 0.6000000238418579, 0.699999988079071, 0.699999988079071, 1.2000000476837158, -0.20000000298023224, -0.30000001192092896, 0.5, -1.2999999523162842, 0.10000000149011612, -0.10000000149011612, 0.699999988079071, 0.20000000298023224, 0, -0.20000000298023224, 0.30000001192092896, 0.5, 0.20000000298023224, 0.6000000238418579, 0.4000000059604645, -0.6000000238418579, -0.5, -0.30000001192092896, -0.4000000059604645, -0.5},
72+
want1: &[]float64{-29293.3, -1365.3, 4448.75, -2606.6, 2927.05, -3256.45, 1611.35, -864.15, 1354.15, -2424, -39.8, 1245.6, 236.7, 383.2, -567.15, 887.05, 789.25, 272.75, 29.7, -115.55, -256.8, 219.2, -18.6, -393.85, -230.2, 374.85, 43.05, 187.2, 229.45, -135.55, -120.65, -131.55, 50.55, 25.4, 114.75, 63.4, 62.45, -17.05, 80.3, 9.6, -110.3, 47.1, -44.5, -56.2, 16.7, 14.05, -56.75, 76.85, 79.15, -77.35, -46.2, -9.25, -12.15, 61.55, -4.15, 15.35, 23.5, -1.1, -11.45, -14.8, -22.85, 18.35, -3.55, 22.65, 11.8, 5.85, -17.5, -10.8, 3.8, 10.15, -22.25, -7.9, 18.25, 10.45, 15.35, -2, -16.8, -3.85, 2.35, 4.8, 4.7, 8, -24.8, 3, 12.1, -0.2, 8.3, -2.5, -3.4, -13.1, -5.3, 2.4, 7.2, 8.6, -0.6, -8.7, 0.8, -12.8, 9.8, -1.3, -6.4, 3.3, 0.2, 0.1, 2, 2.5, -1, 5.4, -0.5, -9, -0.9, 0.4, 1.5, -4.2, 0.9, -3.8, -2.6, 0.9, -3.9, -9, 3, -1.4, 0, -2.5, 2.8, 2.4, -0.6, -0.6, 0.1, 0, 0.5, -0.6, -0.3, -0.1, -1.2, 1.1, -1.7, -1, -2.9, -0.1, -1.8, 2.6, -2.3, -2, -0.1, -1.2, 0.4, 0.6, 1.2, 1, -1.2, -1.5, 0.6, 0, 0.5, 0.6, 0.5, -0.2, -0.1, 0.8, -0.5, 0.1, -0.2, -0.9, -1.2, 0.1, -0.7, 0.2, 0.2, -0.9, -0.9, 0.6, 0.7, 0.7, 1.2, -0.2, -0.3, 0.5, -1.3, 0.1, -0.1, 0.7, 0.2, 0, -0.2, 0.3, 0.5, 0.2, 0.6, 0.4, -0.6, -0.5, -0.3, -0.4, -0.5},
73+
want2: &[]float64{-29280.7, -1355.3, 4427.25, -2617.8, 2921.75, -3283.75, 1603.05, -875.25, 1352.65, -2428.4, -36, 1246, 236.5, 367.6, -571.05, 885.35, 786.95, 271.45, 23.9, -111.45, -251.4, 220.8, -25.4, -397.95, -229.6, 376.15, 42.55, 187.2, 231.55, -134.85, -120.15, -129.25, 52.25, 26.4, 116.65, 63.2, 62.15, -16.75, 81.1, 8, -109.1, 46.7, -45.3, -55.4, 17.1, 14.75, -55.85, 77.75, 79.05, -77.45, -45.6, -9.35, -11.65, 62.05, -4.85, 15.25, 23.5, -1.9, -12.35, -15.6, -22.35, 19.25, -3.85, 22.55, 12, 5.55, -17.5, -10.4, 4.2, 9.85, -22.35, -7.5, 18.55, 9.95, 15.45, -2.6, -16.8, -3.55, 2.65, 5, 4.7, 8, -24.8, 3, 12.1, -0.2, 8.3, -2.5, -3.4, -13.1, -5.3, 2.4, 7.2, 8.6, -0.6, -8.7, 0.8, -12.8, 9.8, -1.3, -6.4, 3.3, 0.2, 0.1, 2, 2.5, -1, 5.4, -0.5, -9, -0.9, 0.4, 1.5, -4.2, 0.9, -3.8, -2.6, 0.9, -3.9, -9, 3, -1.4, 0, -2.5, 2.8, 2.4, -0.6, -0.6, 0.1, 0, 0.5, -0.6, -0.3, -0.1, -1.2, 1.1, -1.7, -1, -2.9, -0.1, -1.8, 2.6, -2.3, -2, -0.1, -1.2, 0.4, 0.6, 1.2, 1, -1.2, -1.5, 0.6, 0, 0.5, 0.6, 0.5, -0.2, -0.1, 0.8, -0.5, 0.1, -0.2, -0.9, -1.2, 0.1, -0.7, 0.2, 0.2, -0.9, -0.9, 0.6, 0.7, 0.7, 1.2, -0.2, -0.3, 0.5, -1.3, 0.1, -0.1, 0.7, 0.2, 0, -0.2, 0.3, 0.5, 0.2, 0.6, 0.4, -0.6, -0.5, -0.3, -0.4, -0.5},
7674
want3: 13,
7775
wantErr: false,
7876
},
@@ -127,7 +125,7 @@ func TestIGRFcoeffs_Coeffs(t *testing.T) {
127125
t.Errorf("IGRFcoeffs.Coeffs() calculated value (start) = %v, reference %v, error %v is more than %v%%", value1, ref_value1, calc_err1, max_error)
128126
}
129127
if calc_err2 > max_error {
130-
t.Errorf("IGRFcoeffs.Coeffs() calculated value (end) = %v, reference %v, error %v is more than %v%%", value1, ref_value2, calc_err2, max_error)
128+
t.Errorf("IGRFcoeffs.Coeffs() calculated value (end) = %v, reference %v, error %v is more than %v%%", value2, ref_value2, calc_err2, max_error)
131129
}
132130
}
133131
})

0 commit comments

Comments
 (0)