Skip to content

Commit 64fb31e

Browse files
Fix script that plots effect of Earth deflection
For pvlib/solposx#148; the script broke when the deflection code started referring to planet masses by integers rather than planet names.
1 parent f698611 commit 64fb31e

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

design/measure_earth_deflection.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111

1212
a1 = lowell.at(t).observe(jupiter).apparent()
1313

14-
relativity.rmasses['earth'] = 1e100 # almost no mass
14+
# Monkey-patch the Earth mass used by the deflection logic so we can see
15+
# what difference that makes for a typical position. Note that 'rmass'
16+
# is an inverse ratio, so a big number means a small mass.
17+
18+
new_earth_rmass = 1e100 # almost no mass
19+
20+
relativity.rmasses[399] = new_earth_rmass
21+
relativity.rmasses['earth'] = new_earth_rmass
22+
1523
a2 = lowell.at(t).observe(jupiter).apparent()
1624

1725
sep_mas = a2.separation_from(a1).mas()

0 commit comments

Comments
 (0)