Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

420 accretion disk tutorial #506

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
python setup.py install
shell: bash -l {0}
env:
CC: gcc-10
CC: gcc-12
- name : build docs
run: |
make html
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
fail-fast: false
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
python setup.py install
shell: bash -l {0}
env:
CC: gcc-10
CC: gcc-12

- name: Test with pytest
run: |
Expand Down
947 changes: 947 additions & 0 deletions docs/source/Accretion_disk.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/source/Start_here.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ All tutorials listed below may be found as Jupyter notebooks under ``docs/source

* :doc:`Emitting patterns 2D projection<Emitting_patterns_2Dprojection>` is a tutorial showing how to use the 2D projection tool for the hot emitting regions on the star's surface.

* :doc:`Accretion disk<Accretion_disk>` is a tutorial showing how to set up and accretion disk and add its emission to the emission of a star.

* :doc:`Importance sampling<Importance_sampling>` is a tutorial for importance sampling.

* :doc:`Module generator tutorial<Module_generator_tutorial>` provides instructions on how to generate Python modules in an automated way to run X-PSI.
Expand Down
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
Polarization
Post-processing
Emitting_patterns_2Dprojection
Accretion_disk
Importance_sampling
Module_generator_tutorial
Example_script_and_modules
Expand Down
46 changes: 19 additions & 27 deletions examples/examples_modeling_tutorial/TestRun_AMXP.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,14 @@ def __call__(self, boundto, caller = None):
T_in = get_T_in_log10_Kelvin(0.16845756373108872) #(0.29)
R_in = 0.308122224729265000E+02 #55.0
values = {'T_in':T_in,'R_in':R_in,'K_disk': k_disk}
disk = Disk(bounds={}, values=values)
bounds_disk = {'T_in': (3., 10.), 'R_in': (0., 1e3), 'K_disk': None}
disk = Disk(bounds=bounds_disk, values=values)

from modules.CustomPhotosphere import CustomPhotosphere_NumA5

stokes = False
stokes = True
bounds = dict(spin_axis_position_angle = (None, None))
photosphere = CustomPhotosphere_NumA5(hot = hot, elsewhere = elsewhere, stokes=stokes, disk=None, bounds=bounds,
photosphere = CustomPhotosphere_NumA5(hot = hot, elsewhere = elsewhere, stokes=stokes, disk=disk, bounds=bounds,
values=dict(mode_frequency = spacetime['frequency']))

photosphere.hot_atmosphere = this_directory+'/model_data/Bobrikova_compton_slab_I.npz'
Expand Down Expand Up @@ -354,31 +355,22 @@ def __call__(self, boundto, caller = None):
#Tbb = 1 keV <=> tbb = 0.002 (roughly)
#Te = 50 keV <=> te = 100 (roughly)

p = [mass, # grav mass
radius, # coordinate equatorial radius
distance, # earth distance kpc
cos_i, # cosine of earth inclination
phase_shift, # phase of hotregion
super_colatitude, # colatitude of centre of superseding region
super_radius, # angular radius superseding region
tbb,
te,
tau,
T_in,
R_in]

if stokes:
p = [mass, #grav mass
radius, #coordinate equatorial radius
distance, # earth distance kpc
cos_i, #cosine of earth inclination
chi0, #spin axis position angle
phase_shift, #phase of hotregion
super_colatitude, #colatitude of centre of superseding region
super_radius, #angular radius superceding region
tbb,
te,
tau
]
elif not stokes:
p = [mass, #grav mass
radius, #coordinate equatorial radius
distance, # earth distance kpc
cos_i, #cosine of earth inclination
phase_shift, #phase of hotregion
super_colatitude, #colatitude of centre of superseding region
super_radius, #angular radius superceding region
tbb,
te,
tau
]
p.insert(4, chi0) # spin axis position angle


# print(len(p))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ def __init__(self,
symbol = r'$f_{\rm mode}$',
value = values.get('mode_frequency', None))

custom = []
if disk is not None:
custom.append(disk)

if stokes:
doc = """
Spin axis position angle measured from the north counterclock-
Expand Down
Loading