Skip to content

Commit 4bdea27

Browse files
STY: extract _MAS_PER_DEG constant in ICRS<->FK5 transform
Replace the bare 3600000.0 conversion factor in _icrs_to_fk5_matrix() with a module-level _MAS_PER_DEG named constant in scientific notation. The value (3,600 arcsec/deg * 1,000 mas/arcsec) is documented in a short side comment. Same float, more self-documenting at the call sites. Per review suggestion from neutrinoceros on PR 19597.
1 parent 12b5c56 commit 4bdea27

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎astropy/coordinates/builtin_frames/icrs_fk5_transforms.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
from .icrs import ICRS
99
from .utils import EQUINOX_J2000
1010

11+
_MAS_PER_DEG = 3.6e6 # 3600 arcseconds * 1000 milliarcseconds
12+
1113

1214
def _icrs_to_fk5_matrix():
1315
"""
1416
B-matrix from USNO circular 179. Used by the ICRS->FK5 transformation
1517
functions.
1618
"""
17-
eta0 = -19.9 / 3600000.0
18-
xi0 = 9.1 / 3600000.0
19-
da0 = -22.9 / 3600000.0
19+
eta0 = -19.9 / _MAS_PER_DEG
20+
xi0 = 9.1 / _MAS_PER_DEG
21+
da0 = -22.9 / _MAS_PER_DEG
2022

2123
return (
2224
rotation_matrix(-eta0, "x")

0 commit comments

Comments
 (0)