Skip to content

Commit

Permalink
Merge branch 'itrf2020' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
tayden committed Dec 6, 2022
2 parents a5654af + ec5a587 commit 1602afe
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions csrspy/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Reference(str, Enum):
ITRF05 = 'itrf05'
ITRF08 = 'itrf08'
ITRF14 = 'itrf14'
ITRF20 = 'itrf20'


class CoordType(str, Enum):
Expand Down
4 changes: 4 additions & 0 deletions csrspy/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def from_ref_frame(cls, ref_frame: Union[Reference, str]):
return cls(1.00530, 0.00079, -1.90921, -0.00060, -0.54157, -0.00144, -26.78138,
-0.06667, 0.42027, 0.75744, -10.93206, 0.05133, 0.36891, -0.07201, 2010)

elif ref_frame == Reference.ITRF20:
return cls(1.00390, 0.00079, -1.90961, -0.00070, -0.54117, -0.00124, -26.78138,
-0.06667, 0.42027, 0.75744, -10.93206, 0.05133, -0.05109, -0.07201, 2010)

else:
raise KeyError(ref_frame)

Expand Down
22 changes: 22 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,17 @@
(472952.339, 5363983.280, 18.806),
0.001, 0.018
),
(
{
"s_ref_frame": Reference.ITRF20, 't_ref_frame': Reference.NAD83CSRS,
's_coords': CoordType.UTM10, 't_coords': CoordType.UTM10,
's_epoch': 2010, 't_epoch': 2010,
's_vd': VerticalDatum.GRS80, 't_vd': VerticalDatum.GRS80
},
(472952.399, 5363983.346, 0.291),
(472953.729, 5363982.898, 0.580),
0.001, 0.001
),
])
def test_csrs_transformer_itrf_to_nad83(transform_config, test_input, expected, xy_err, h_err):
trans = CSRSTransformer(**transform_config)
Expand Down Expand Up @@ -566,6 +577,17 @@ def test_csrs_transformer_itrf_to_nad83(transform_config, test_input, expected,
(-123.365646, 48.428421, 0),
1e-7, 0.001
),
(
{
"t_ref_frame": Reference.ITRF20, 's_ref_frame': Reference.NAD83CSRS,
't_coords': CoordType.UTM10, 's_coords': CoordType.UTM10,
't_epoch': 2010.00, 's_epoch': 2010.000,
't_vd': VerticalDatum.GRS80, 's_vd': VerticalDatum.GRS80
},
(472952.399, 5363983.346, 0.291),
(472951.069, 5363983.794, 0.002),
0.001, 0.001
),
])
def test_csrs_transformer_nad83_to_itrf(transform_config, test_input, expected, xy_err, h_err):
trans = CSRSTransformer(**transform_config)
Expand Down

0 comments on commit 1602afe

Please sign in to comment.