# Path: DiscEvolution/star.py
# class PhotoStar(SimpleStar):
#     def __init__(self, LX=1e30, Phi=0, **kwargs):
#         super().__init__(**kwargs)
#         self._L_X = LX
#         self._Phi = Phi
# 
#     @property
#     def L_X(self):
#         """X-ray Luminosity"""
#         return self._L_X
# 
#     @property
#     def Phi(self):
#         """EUV Photon Luminosity"""
#         return self._Phi


import numpy as np
import argparse
import json
import matplotlib.pyplot as plt
from DiscEvolution.constants import *
from DiscEvolution.star import PhotoStar
from scipy.signal import argrelmin
    from control_scripts import run_model
    Sigma_dot_plot()
    Test_Removal()

def Test_Removal():
    """Removes gas fom a power law disc in regular timesteps without viscous evolution etc"""
    star1 = PhotoStar(LX=1e30, M=1.0, R=2.5, T_eff=4000)
    R = np.linspace(0.1,200,2000)
    disc1 = DummyDisc(R, star1, RC=10)

    internal_photo = XrayDiscPicogna(disc1)

    plt.figure()
    for t in np.linspace(0,2e3,6):
        internal_photo(disc1, 2e3)
        plt.loglog(0.5*(R[1:]+R[:-1]), disc1.Sigma, label='{}'.format(t))
    plt.xlabel("R / AU")
    plt.ylabel("$\Sigma_G~/~\mathrm{g~cm^{-2}}$")
    plt.legend(title='Time / yr')
    plt.show()

def Sigma_dot_plot():
    """Plot a comparison of the mass loss rate prescriptions"""
    # Set up dummy model
    parser = argparse.ArgumentParser()
    parser.add_argument("--model", "-m", type=str, default=DefaultModel)
    args = parser.parse_args()
    model = json.load(open(args.model, 'r'))
    plt.figure(figsize=(6,6))

    starX = PhotoStar(LX=1e30,  M=model['star']['mass'], R=model['star']['radius'], T_eff=model['star']['T_eff'])

# Path: DiscEvolution/star.py
# class PhotoStar(SimpleStar):
#     def __init__(self, LX=1e30, Phi=0, **kwargs):
#         super().__init__(**kwargs)
#         self._L_X = LX
#         self._Phi = Phi
# 
#     @property
#     def L_X(self):
#         """X-ray Luminosity"""
#         return self._L_X
# 
#     @property
#     def Phi(self):
#         """EUV Photon Luminosity"""
#         return self._Phi


# Path: DiscEvolution/internal_photo.py
import numpy as np
import argparse
import json
import matplotlib.pyplot as plt
from DiscEvolution.constants import *
from DiscEvolution.star import PhotoStar
from scipy.signal import argrelmin
    from control_scripts import run_model

    Sigma_dot_plot()
    Test_Removal()

def Test_Removal():
    """Removes gas fom a power law disc in regular timesteps without viscous evolution etc"""
    star1 = PhotoStar(LX=1e30, M=1.0, R=2.5, T_eff=4000)
    R = np.linspace(0.1,200,2000)
    disc1 = DummyDisc(R, star1, RC=10)

    internal_photo = XrayDiscPicogna(disc1)

    plt.figure()
    for t in np.linspace(0,2e3,6):
        internal_photo(disc1, 2e3)
        plt.loglog(0.5*(R[1:]+R[:-1]), disc1.Sigma, label='{}'.format(t))
    plt.xlabel("R / AU")
    plt.ylabel("$\Sigma_G~/~\mathrm{g~cm^{-2}}$")
    plt.legend(title='Time / yr')
    plt.show()

def Sigma_dot_plot():
    """Plot a comparison of the mass loss rate prescriptions"""
    # Set up dummy model
    parser = argparse.ArgumentParser()
    parser.add_argument("--model", "-m", type=str, default=DefaultModel)
    args = parser.parse_args()
    model = json.load(open(args.model, 'r'))
    plt.figure(figsize=(6,6))

    starX = PhotoStar(LX=1e30,  M=model['star']['mass'], R=model['star']['radius'], T_eff=model['star']['T_eff'])

    starE = PhotoStar(Phi=1e42, M=model['star']['mass'], R=model['star']['radius'], T_eff=model['star']['T_eff'])