-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixes implementation of gravitational redshift. * fixes an unitialized value problem in gradients resulting in nans for effective temperatures. * minor updates to passband exporting to support upcoming 2.5 release on the passbands server. * allows setting SelectParameter to an array or tuple (in addition to a list). --------- Co-authored-by: Andrej Prsa <aprsa09@gmail.com>
- Loading branch information
Showing
12 changed files
with
98 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
""" | ||
|
||
__version__ = '2.4.9' | ||
__version__ = '2.4.10' | ||
|
||
import os as _os | ||
import sys as _sys | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Test gravitational redshift for the Sun. The theoretically | ||
# predicted value from GTR is ~633 m/s. | ||
# | ||
# The Sun-Jupiter system | ||
# expected RV semi-amplitude of the Sun is 12.5 m/s. | ||
|
||
# import numpy as np | ||
|
||
import phoebe | ||
from phoebe import u, c | ||
# import libphoebe | ||
|
||
|
||
def initiate_sun_jupiter_system(): | ||
b = phoebe.default_binary() | ||
|
||
b['teff@primary'] = 1.*u.solTeff | ||
b['requiv@primary'] = 1.*u.solRad | ||
b['syncpar@primary'] = 14.61 | ||
|
||
b['period@orbit'] = 11.852*u.yr | ||
b['q@orbit'] = 1.26687e17/1.3271244e20 # (GM)_J / (GM)_Sun | ||
b['sma@orbit'] = 5.2*u.au | ||
|
||
b['teff@secondary'] = (500, 'K') | ||
b['requiv@secondary'] = 1.*c.R_jup | ||
b['atm@secondary'] = 'blackbody' | ||
|
||
b['ld_mode_bol@secondary'] = 'manual' | ||
b['ld_func_bol@secondary'] = 'linear' | ||
b['ld_coeffs_bol@secondary'] = [0.5] | ||
|
||
b.add_dataset('rv', times=[0,], dataset='grv', passband='Johnson:V') | ||
|
||
b['rv_grav@secondary@grv'] = True | ||
b['ld_mode@secondary@grv'] = 'manual' | ||
b['ld_func@secondary@grv'] = 'linear' | ||
b['ld_coeffs@secondary@grv'] = [0.5] | ||
|
||
return b | ||
|
||
|
||
def test_rvgrav(): | ||
b = initiate_sun_jupiter_system() | ||
|
||
# first run without rv_grav: | ||
b.run_compute(rv_grav=False, model='without_rvg') | ||
|
||
# second run with rv_grav: | ||
b.run_compute(rv_grav=True, model='with_rvg') | ||
|
||
rv_diff = b['value@rvs@primary@with_rvg'][0]-b['value@rvs@primary@without_rvg'][0] | ||
|
||
assert abs(rv_diff-0.6363) < 1e-3 | ||
|
||
|
||
if __name__ == '__main__': | ||
# logger = phoebe.logger(clevel='INFO') | ||
|
||
test_rvgrav() |