Exemplo n.º 1
0
def shellmaker(b,inc):
    """
    Creates the projected and normalized bowshock shape
    Entries:
    b: momentum rate ratio between proplyd and massive star. Scalar
    inc: orientation angle of proplyd: scalar
    """
    Nth = 800
    tfit = 45
    
    shell = Shell(beta=b, innertype="proplyd")
    thlim = theta_lim(b)
    theta = np.linspace(0, thlim, Nth)
    R = shell.radius(theta)
    w = omega(R, theta)
    SenodePhiT = (np.tan(inc) * ((1 + w*np.tan(theta)) /
                                     (w - np.tan(theta))))
    # other way to set mask
    SenodePhiT[np.abs(SenodePhiT) >= 1.] = np.nan

    # Correct for projection and for fact that observed radii are normalised by
    # D' = D cos(inc)
    xi = (R/np.cos(inc))*(np.cos(theta)*np.cos(inc)
                          - np.sin(theta)*SenodePhiT*np.sin(inc))
    yi = (R/np.cos(inc))*np.sin(theta)*np.sqrt(1-SenodePhiT**2)
    mask = np.isfinite(xi) & np.isfinite(yi)
    xim, yim = xi[mask], yi[mask]  # Removing nan elements from xi
                                   # and yi
    #Creating the other part of bowshock
    xplot, yplot = np.array([xim, xim]), np.array([-yim, yim])
    x2, y2 = xplot.reshape(2*len(xim),), yplot.reshape(2*len(yim),)
    return x2,y2
Exemplo n.º 2
0
parser = argparse.ArgumentParser(description = "model parameters")
parser.add_argument("--beta",type= float,default=0.01,help="two winds momentum ratio")
parser.add_argument("--type",type=str,default="isotropic",help="type of inner wind")
parser.add_argument("--mach",type=float,default=3.0,help="Mach number of inner wind")
cmd_args = parser.parse_args()

#1
beta = cmd_args.beta
if cmd_args.type=="isotropic":
    theta = np.linspace(0,theta_lim(beta),1500)
elif cmd_args.type=="proplyd":
    theta = np.linspace(0,np.pi,1500)
else:
    print("Unknown shell type")
    sys.exit()
shell = Shell(beta,cmd_args.type)
R = shell.radius(theta)
R[R<0]=np.nan
R_in = inner(R,theta,cmd_args.mach)
R_com,theta_com = mirror(R_in,theta)





arcdata = {
    "info":{
        "Description": "CRW theoretical stationary bowshocks",
        "history":["Initially created by "+ run_info()],
        "beta": beta,
        "inner wind type": cmd_args.type
Exemplo n.º 3
0
theta = np.linspace(0,0.99*np.pi)

parser =argparse.ArgumentParser(description="choose figure output")
parser.add_argument("--fig",type=int,default=0,choices=[0,1],help="figure output")
args = parser.parse_args()
flag = args.fig <= 0
inner_list = ["isotropic","proplyd"]
xi_list = [1.0,0.8,0.2]
line_dict = {"isotropic":"--","proplyd":"-"}
line_list = ["--","-",":",]
color_list = ["r","g","b","m","c","k"]
#label = {"isotropic":None,"proplyd":r"$\beta={}$".format(b)}
if flag:
    for xi,line in zip(xi_list,line_list):
        for b,col in zip(beta,color_list):
            shell = Shell(beta=b,innertype="anisotropic",xi=xi)
            R = shell.radius(theta)
            R[R<=0] = np.nan
            if xi==0.8:
                label = r"$\beta={}$".format(b)
            else:
                label = None
            plt.plot(R*np.cos(theta),R*np.sin(theta),color=col,linestyle=line,
                     label=label)

    plt.legend(fontsize="small")
    plt.xlabel(r"$z/D$")
    plt.ylabel(r"$r/D$")
    plt.gca().set_aspect("equal",adjustable="box")
    plt.xlim(-0.4,1)
    plt.ylim(0,1)
Exemplo n.º 4
0
N = 1000
h=1e-3
theta = np.linspace(0,np.pi,N)
beta = np.array([1.0, 0.2, 0.05, 0.02, 0.005])
innertype = ['isotropic']# 'proplyd']
# Use semi-open interval -pi->pi for phi
phi = np.linspace(-np.pi,np.pi,N, endpoint=False) 
#Phi is the azimutal angle in spherical coordinates to make the revolution surface of proplyd
#Meshgrid theta and phi:
THETA,PHI = np.meshgrid(theta,phi)
DPHI = 2*np.pi/N
i = np.linspace(0.0, 0.5*np.pi, 19)
for inn in innertype:
    print "******{} case******".format(inn)
    for b in beta:
        shell = Shell(beta=b,innertype=inn)
#Calculing R(theta)
        R=shell.radius(theta)
        Rdr = shell.radius(theta + h)
        R[R<=0] = np.nan # Set neagtive R to NaN
        # W = OMEGA(R,Rdr,h)
        W = omega(R, theta)

        # Check that R(theta) is working correctly
        plt.plot(theta, R)
        plt.yscale('log')
        plt.savefig("R-vs-theta-{}-{}.png".format(inn, b))
        plt.clf()

        # Check that omega is working correctly
        plt.plot(theta, W)
Exemplo n.º 5
0

parser = argparse.ArgumentParser(description= """Inputs: wind type and inner wind parameter "beta" """)
parser.add_argument("--beta",type=float,default = 0.01,help= "winds momentum-rate ratio")
parser.add_argument("--innertype",type=str,choices=("isotropic","proplyd"),default="proplyd",help="inner wind model")
parser.add_argument("--shell",action="store_true",help="If true, plot the shell shape, else plot h vs theta")
parser.add_argument("--inc",type=float,default = 15.0,help="inlination angle (in degrees) between proplyd reference frame and plane of sky reference frame")
cmd_args=parser.parse_args()
beta = cmd_args.beta
innertype = cmd_args.innertype

#1:
Nth = 800
th_lim = theta_lim(beta)
theta = np.linspace(0,np.radians(130),Nth)
shell = Shell(beta=beta,innertype=innertype)
inc = np.radians(cmd_args.inc)


#Add the analytic fit found for A = Rc/R0
y0 = {"proplyd":0.66,"isotropic": 0.585}
b = {"proplyd":50.0,"isotropic":5.0}
c = np.exp(-1./b[innertype])
d = {"proplyd": 0.49, "isotropic": 0.5}
A =  (1-c)/(y0[innertype]*(np.exp(-beta**d[innertype]/b[innertype])-c))
a = (A-1)/A


#The respective radii (CRW and circular)
R_ext = shell.radius(theta)
R0=R_ext[0]