In [1]:
import yt
import os
import math
from yt import derived_field
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
from yt.units import pc, kpc, second, Kelvin, gram, erg, cm

import Read_binary as Rd
import Reconstruct_UG as RUG
import Vector_computations as vec
import Locate_Nearby_SN as NSN

import copy
from matplotlib.colors import LogNorm

import matplotlib
from matplotlib.ticker import MaxNLocator
from matplotlib import cm as cmap
from mpl_toolkits.mplot3d import Axes3D

import numpy
from numpy.random import randn

from scipy.spatial import Voronoi, voronoi_plot_2d

%matplotlib inline

#import Read_particles as Rd

ppc = 3.0856e18

mp      = 1.6726e-24# g
mu      = 1.2924
kb      = 1.3806e-16   # erg K-1
GNewton = 6.6743e-8   # cm3 g-1 s-2
Msun    = 1.9884e33   # gram
mm      = mu*mp

# Create a derived field.
@derived_field(name="numdens", units="1/cm**3", force_override=True)
def numdens(field, data):
    dens_here = data["dens"].value
    dens_here = dens_here / cm**3
    return dens_here/mm

yt.add_field('numdens', function=numdens, units="1/cm**3", force_override=True)
In [2]:
Cloud_name = "M8e3"
resolution = 0.5

tinit  = 0.0
tfin   = 9.7

snapshot = 10

if resolution < 0.1:
    resolution_str = "%.3i" %(resolution*100)
else:
    resolution_str = "%.2i" %(resolution*10)
In [3]:
# Load the Cloud object information.
In [4]:
Nearby_SN = NSN.Locate_Nearby_SN(Cloud_name, min_dist=100)
NSN.Print_Nearby_SN(Nearby_SN)
t = 0.62 	, d = 44.47 	, px = -28.92, py = 14.09, pz = -30.70
t = 5.26 	, d = 85.52 	, px = -32.72, py = -69.46, pz = 37.67
t = 6.08 	, d = 68.94 	, px = 31.85, py = 2.70, pz = -61.08
t = 8.99 	, d = 85.92 	, px = -2.33, py = 78.66, pz = -34.49
In [5]:
global_data01, global_props01 = Rd.Restore_Cloud_Evolution(Cloud_name, 0.1, 0, tfin, nmin=100)
global_data05, global_props05 = Rd.Restore_Cloud_Evolution(Cloud_name, 0.5, 0, tfin, nmin=100)
global_data1, global_props1   = Rd.Restore_Cloud_Evolution(Cloud_name, 1,   0, tfin, nmin=100)
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
In [6]:
# Jeans_length_crit = 3.31 * (n / 100)**(-0.5)

n_crit01 = (3.31 / (4*0.1 ))**2 * 100
n_crit05 = (3.31 / (4*0.47))**2 * 100
n_crit1  = (3.31 / (4*0.95))**2 * 100 * 2

print n_crit01, n_crit05, n_crit1
6847.5625 309.984721593 151.746537396
In [7]:
global_data_ncrit01, global_props_ncrit01 = Rd.Restore_Cloud_Evolution(Cloud_name, 0.1, 0, tfin, nmin=n_crit01)
global_data_ncrit05, global_props_ncrit05 = Rd.Restore_Cloud_Evolution(Cloud_name, 0.5, 0, tfin, nmin=n_crit05)
global_data_ncrit1, global_props_ncrit1   = Rd.Restore_Cloud_Evolution(Cloud_name, 1,   0, tfin, nmin=n_crit1)
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp000.dat
Reading the File M8e3_CloudObject_snp001.dat
Reading the File M8e3_CloudObject_snp002.dat
Reading the File M8e3_CloudObject_snp003.dat
Reading the File M8e3_CloudObject_snp004.dat
Reading the File M8e3_CloudObject_snp005.dat
Reading the File M8e3_CloudObject_snp006.dat
Reading the File M8e3_CloudObject_snp007.dat
Reading the File M8e3_CloudObject_snp008.dat
Reading the File M8e3_CloudObject_snp009.dat
Reading the File M8e3_CloudObject_snp010.dat
Reading the File M8e3_CloudObject_snp011.dat
Reading the File M8e3_CloudObject_snp012.dat
Reading the File M8e3_CloudObject_snp013.dat
Reading the File M8e3_CloudObject_snp014.dat
Reading the File M8e3_CloudObject_snp015.dat
Reading the File M8e3_CloudObject_snp016.dat
Reading the File M8e3_CloudObject_snp017.dat
Reading the File M8e3_CloudObject_snp018.dat
Reading the File M8e3_CloudObject_snp019.dat
Reading the File M8e3_CloudObject_snp020.dat
Reading the File M8e3_CloudObject_snp021.dat
Reading the File M8e3_CloudObject_snp022.dat
Reading the File M8e3_CloudObject_snp023.dat
Reading the File M8e3_CloudObject_snp024.dat
Reading the File M8e3_CloudObject_snp025.dat
Reading the File M8e3_CloudObject_snp026.dat
Reading the File M8e3_CloudObject_snp027.dat
Reading the File M8e3_CloudObject_snp028.dat
Reading the File M8e3_CloudObject_snp029.dat
Reading the File M8e3_CloudObject_snp030.dat
Reading the File M8e3_CloudObject_snp031.dat
Reading the File M8e3_CloudObject_snp032.dat
Reading the File M8e3_CloudObject_snp033.dat
Reading the File M8e3_CloudObject_snp034.dat
Reading the File M8e3_CloudObject_snp035.dat
Reading the File M8e3_CloudObject_snp036.dat
Reading the File M8e3_CloudObject_snp037.dat
Reading the File M8e3_CloudObject_snp038.dat
Reading the File M8e3_CloudObject_snp039.dat
Reading the File M8e3_CloudObject_snp040.dat
Reading the File M8e3_CloudObject_snp041.dat
Reading the File M8e3_CloudObject_snp042.dat
Reading the File M8e3_CloudObject_snp043.dat
Reading the File M8e3_CloudObject_snp044.dat
Reading the File M8e3_CloudObject_snp045.dat
Reading the File M8e3_CloudObject_snp046.dat
Reading the File M8e3_CloudObject_snp047.dat
Reading the File M8e3_CloudObject_snp048.dat
Reading the File M8e3_CloudObject_snp049.dat
Reading the File M8e3_CloudObject_snp050.dat
Reading the File M8e3_CloudObject_snp051.dat
Reading the File M8e3_CloudObject_snp052.dat
Reading the File M8e3_CloudObject_snp053.dat
Reading the File M8e3_CloudObject_snp054.dat
Reading the File M8e3_CloudObject_snp055.dat
Reading the File M8e3_CloudObject_snp056.dat
Reading the File M8e3_CloudObject_snp057.dat
Reading the File M8e3_CloudObject_snp058.dat
Reading the File M8e3_CloudObject_snp059.dat
Reading the File M8e3_CloudObject_snp060.dat
Reading the File M8e3_CloudObject_snp061.dat
Reading the File M8e3_CloudObject_snp062.dat
Reading the File M8e3_CloudObject_snp063.dat
Reading the File M8e3_CloudObject_snp064.dat
Reading the File M8e3_CloudObject_snp065.dat
Reading the File M8e3_CloudObject_snp066.dat
Reading the File M8e3_CloudObject_snp067.dat
Reading the File M8e3_CloudObject_snp068.dat
Reading the File M8e3_CloudObject_snp069.dat
Reading the File M8e3_CloudObject_snp070.dat
Reading the File M8e3_CloudObject_snp071.dat
Reading the File M8e3_CloudObject_snp072.dat
Reading the File M8e3_CloudObject_snp073.dat
Reading the File M8e3_CloudObject_snp074.dat
Reading the File M8e3_CloudObject_snp075.dat
Reading the File M8e3_CloudObject_snp076.dat
Reading the File M8e3_CloudObject_snp077.dat
Reading the File M8e3_CloudObject_snp078.dat
Reading the File M8e3_CloudObject_snp079.dat
Reading the File M8e3_CloudObject_snp080.dat
Reading the File M8e3_CloudObject_snp081.dat
Reading the File M8e3_CloudObject_snp082.dat
Reading the File M8e3_CloudObject_snp083.dat
Reading the File M8e3_CloudObject_snp084.dat
Reading the File M8e3_CloudObject_snp085.dat
Reading the File M8e3_CloudObject_snp086.dat
Reading the File M8e3_CloudObject_snp087.dat
Reading the File M8e3_CloudObject_snp088.dat
Reading the File M8e3_CloudObject_snp089.dat
Reading the File M8e3_CloudObject_snp090.dat
Reading the File M8e3_CloudObject_snp091.dat
Reading the File M8e3_CloudObject_snp092.dat
Reading the File M8e3_CloudObject_snp093.dat
Reading the File M8e3_CloudObject_snp094.dat
Reading the File M8e3_CloudObject_snp095.dat
Reading the File M8e3_CloudObject_snp096.dat
Reading the File M8e3_CloudObject_snp097.dat
In [8]:
Mass_ratio_resolved01 = np.array(global_props_ncrit01["mass"]) / np.array(global_props01["mass"])
Mass_ratio_resolved05 = np.array(global_props_ncrit05["mass"]) / np.array(global_props05["mass"])
Mass_ratio_resolved1 =  np.array(global_props_ncrit1["mass"]) / np.array(global_props1["mass"])

# Locate the Point where the fragmentation and gravitational collapse is unresolved.
for i in range(len(Mass_ratio_resolved01)):
    if Mass_ratio_resolved01[i] >= 0.50:
        print("Cloud %s is unresolved after %i snapshots"%(Cloud_name, i))
        unresolved_index01 = i
        break
        
# Locate the Point where the fragmentation and gravitational collapse is unresolved.
for i in range(len(Mass_ratio_resolved05)):
    if Mass_ratio_resolved05[i] >= 0.50:
        print("Cloud %s is unresolved after %i snapshots"%(Cloud_name, i))
        unresolved_index05 = i
        break
        
# Locate the Point where the fragmentation and gravitational collapse is unresolved.
for i in range(len(Mass_ratio_resolved1)):
    if Mass_ratio_resolved1[i] >= 0.50:
        print("Cloud %s is unresolved after %i snapshots"%(Cloud_name, i))
        unresolved_index1 = i
        break
Cloud M8e3 is unresolved after 62 snapshots
Cloud M8e3 is unresolved after 26 snapshots
Cloud M8e3 is unresolved after 0 snapshots
In [9]:
ncloud = np.zeros_like(global_props01["time"])

ncloud = np.array(global_props01["mass"])/np.array(global_props01["volume"]) / mm
In [10]:
Mass_accretion01 = np.zeros_like(global_props01["time"])
Mass_accretion05 = np.zeros_like(global_props05["time"])
Mass_accretion1  = np.zeros_like(global_props1["time"])

for i in range(len(Mass_accretion01)-2):

    j = i+1
    
    Mass_accretion01[j] = (global_props01["mass"][j+1] - global_props01["mass"][j-1]) / Msun / \
                        ((global_props01["time"][j+1] - global_props01["time"][j-1])*1.0e6)

    Mass_accretion05[j] = (global_props05["mass"][j+1] - global_props05["mass"][j-1]) / Msun / \
                        ((global_props05["time"][j+1] - global_props05["time"][j-1])*1.0e6)

    Mass_accretion1[j]  = (global_props1["mass"][j+1] - global_props1["mass"][j-1]) / Msun / \
                        ((global_props1["time"][j+1] - global_props1["time"][j-1])*1.0e6)

        
Mass_accretion01[-1] = Mass_accretion01[-2]
Mass_accretion05[-1] = Mass_accretion05[-2]
Mass_accretion1[-1]  = Mass_accretion1[-2]
In [11]:
print np.mean(Mass_accretion01)
print np.mean(Mass_accretion05)
print np.mean(Mass_accretion1)
0.000483008033708
0.000445928705711
0.000523220014319

In [33]:
fig = plt.figure(figsize=(18, 12))

# Cloud Mass
################################################
ax = fig.add_subplot(221)

min_mass = np.min(global_props01["mass"]) 
max_mass = np.max(global_props01["mass"]) 

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [min_mass/Msun-2000, max_mass/Msun+300]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        #ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.95 + yy[0]
        #ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)

ax.plot(global_props01["time"], np.array(global_props01["mass"])/Msun,  "-k", linewidth=2, label="$\Delta x=0.12$ pc")
ax.plot(global_props05["time"], np.array(global_props05["mass"])/Msun,  "--k", linewidth=2, label="$\Delta x=0.47$ pc")
ax.plot(global_props1 ["time"], np.array(global_props1 ["mass"])/Msun,  ":k", linewidth=2, label="$\Delta x=0.95$ pc")

ax.plot([global_props01["time"][unresolved_index01],global_props01["time"][unresolved_index01]], yy, "-k", linewidth=3)
ax.plot([global_props05["time"][unresolved_index05],global_props05["time"][unresolved_index05]], yy, "--k", linewidth=3)
ax.plot([global_props1 ["time"][unresolved_index1], global_props1 ["time"][unresolved_index1]],  yy, ":k", linewidth=3) 

ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Mass [M$_{\odot}$]", fontsize=15)
ax.set_title("Cloud Mass", fontsize=15)

ax.legend(loc=4, fontsize=20)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 


ax.set_ylim(min_mass/Msun-2000, max_mass/Msun+300)
ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

Lx =  global_props01["time"][unresolved_index01]
Ly =  (max_mass - min_mass )/Msun
ax.text(1.01*Lx, min_mass/Msun + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.12$ pc", fontsize=13)

Lx =  global_props05["time"][unresolved_index05]
Ly =  (max_mass - min_mass )/Msun
ax.text(1.01*Lx, min_mass/Msun + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


# Cloud Radius
################################################
ax = fig.add_subplot(223)

min_rad = 4
max_rad = 7 

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [min_rad, max_rad]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        #ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.95 + yy[0]
        #ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Radius [pc]", fontsize=15)
ax.set_title("Cloud Radius", fontsize=15)


ax.plot(global_props01["time"], np.array(global_props01["radius"])/ppc,  "-k", linewidth=2, label="$\Delta x=0.12$ pc")
ax.plot(global_props05["time"], np.array(global_props05["radius"])/ppc,  "--k", linewidth=2, label="$\Delta x=0.47$ pc")
ax.plot(global_props1 ["time"], np.array(global_props1 ["radius"])/ppc,  ":k", linewidth=2, label="$\Delta x=0.95$ pc")

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)

ax.set_ylim(min_rad, max_rad)
ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])


ax.plot([global_props01["time"][unresolved_index01],global_props01["time"][unresolved_index01]], yy, "-k", linewidth=3)
ax.plot([global_props05["time"][unresolved_index05],global_props05["time"][unresolved_index05]], yy, "--k", linewidth=3)
ax.plot([global_props1 ["time"][unresolved_index1], global_props1 ["time"][unresolved_index1]],  yy, ":k", linewidth=3) 


Lx =  global_props01["time"][unresolved_index01]
Ly =  (max_rad - min_rad )
ax.text(1.01*Lx, min_rad + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.12$ pc", fontsize=13)

Lx =  global_props05["time"][unresolved_index05]
Ly =  (max_rad - min_rad )
ax.text(1.01*Lx, min_rad + 0.05*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


# Virial Parameter
################################################
ax = fig.add_subplot(222)


ax.plot(global_props01["time"], np.array(global_props01["alpha_virial"]), "-k", linewidth=2, label="0.12 pc")
ax.plot(global_props05["time"], np.array(global_props05["alpha_virial"]), "--k", linewidth=2, label="0.47 pc")
ax.plot(global_props1["time"],  np.array(global_props1["alpha_virial"]),  ":k", linewidth=2, label="0.95 pc")


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("alpha virial", fontsize=15)
ax.set_title("Virial Parameter", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])

min_virial = np.min(global_props01["alpha_virial"]) 
max_virial = np.max(global_props01["alpha_virial"])
Ly       =  (max_virial - min_virial ) 

ax.set_ylim(1.0e-1, max_virial + Ly)

ax.set_yscale("log")

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)


yy = [1.0e-1, max_virial + Ly]

ax.plot([global_props01["time"][unresolved_index01],global_props01["time"][unresolved_index01]], yy, "-k", linewidth=3)
ax.plot([global_props05["time"][unresolved_index05],global_props05["time"][unresolved_index05]], yy, "--k", linewidth=3)
ax.plot([global_props1 ["time"][unresolved_index1], global_props1 ["time"][unresolved_index1]],  yy, ":k", linewidth=3) 

Lx =  global_props01["time"][unresolved_index01]
Ly =  yy[1] - yy[0]
ax.text(1.01*Lx, yy[0] + 0.5*Ly, "Unresolved\ncollapse\n$\Delta x=0.12$ pc", fontsize=13)

Lx =  global_props05["time"][unresolved_index05]
ax.text(1.01*Lx, yy[0] + 0.5*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)



# Total velocity dispersion
################################################
ax = fig.add_subplot(224)


ax.plot(global_props01["time"], np.array(global_props01["vel_disp_total"])/1.0e5,  "-k", linewidth=2, label="0.12 pc")
ax.plot(global_props05["time"], np.array(global_props05["vel_disp_total"])/1.0e5,  "--k", linewidth=2, label="0.47 pc")
ax.plot(global_props1["time"],  np.array(global_props1["vel_disp_total"])/1.0e5,  ":k", linewidth=2, label="0.95 pc")

ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("$\sigma_{tot}$ [km s$^{-1}$]", fontsize=15)
ax.set_title("Total velocity dispersion", fontsize=15)


ax.set_ylim(0.2, 2.2)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])


start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)

yy = [0.2, 2.2]

ax.plot([global_props01["time"][unresolved_index01],global_props01["time"][unresolved_index01]], yy, "-k", linewidth=3)
ax.plot([global_props05["time"][unresolved_index05],global_props05["time"][unresolved_index05]], yy, "--k", linewidth=3)
ax.plot([global_props1 ["time"][unresolved_index1], global_props1 ["time"][unresolved_index1]],  yy, ":k", linewidth=3) 


Lx =  global_props01["time"][unresolved_index01]
Ly =  yy[1] - yy[0]
ax.text(1.01*Lx, yy[0] + 0.05*Ly, "Unresolved\ncollapse\n$\Delta x=0.12$ pc", fontsize=13)

Lx =  global_props05["time"][unresolved_index05]
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)

fig.tight_layout()

fig.show()

save_dir = "/home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/"
filename = Cloud_name + "_Mass-Rad-alpha-sigma"

fig.savefig("%s%s.pdf"%(save_dir, filename), format='pdf')
print("Saving Figure: %s%s.pdf"%(save_dir, filename))
Saving Figure: /home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/M8e3_Mass-Rad-alpha-sigma.pdf
In [28]:
fig = plt.figure(figsize=(18, 6))

# Mass accretion rate.
################################################

ax = fig.add_subplot(131)

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [1.0e-4, 4.0e-3]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.85 + yy[0]
        ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)


Acc_pos01, Acc_neg01 = np.zeros_like(Mass_accretion01), np.zeros_like(Mass_accretion01)
Acc_pos05, Acc_neg05 = np.zeros_like(Mass_accretion05), np.zeros_like(Mass_accretion05)
Acc_pos1 , Acc_neg1  = np.zeros_like(Mass_accretion1),  np.zeros_like(Mass_accretion1)

for i in range(len(Acc_neg01)):
    if Mass_accretion01[i] > 0:
        Acc_pos01[i] = Mass_accretion01[i]
        Acc_neg01[i] = 1.0e-99

        Acc_pos05[i] = Mass_accretion05[i]
        Acc_neg05[i] = 1.0e-99
        
        Acc_pos1[i] = Mass_accretion1[i]
        Acc_neg1[i] = 1.0e-99
    else:
        Acc_neg01[i] = np.abs(Mass_accretion01[i])
        Acc_pos01[i] = 1.0e-99

        Acc_neg05[i] = np.abs(Mass_accretion05[i])
        Acc_pos05[i] = 1.0e-99
        
        Acc_neg1[i] = np.abs(Mass_accretion1[i])
        Acc_pos1[i] = 1.0e-99

        

        
ax.plot(global_props01["time"], Acc_pos01,  "-k", linewidth=2)
ax.plot(global_props01["time"], Acc_neg01,  "--k", linewidth=2)


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Accretion rate [M$_{\odot}$ yr$^{-1}$]", fontsize=15)
ax.set_title("Mass Accretion, $\Delta x=0.12$ pc", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)

    
ax.set_ylim(1.0e-4, 4.0e-3)
ax.set_yscale("log")    

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

# ====================================================================================

ax = fig.add_subplot(132)

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [1.0e-4, 4.0e-3]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.85 + yy[0]
        ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)

        

ax.plot(global_props01["time"], Acc_pos05,  "-k", linewidth=2)
ax.plot(global_props01["time"], Acc_neg05,  "--k", linewidth=2)




ax.set_xlabel("time [Myr]", fontsize=15)
#ax.set_ylabel("Accretion rate [M$_{\odot}$ yr$^{-1}$]", fontsize=15)
ax.set_title("Mass Accretion, $\Delta x=0.47$ pc", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_ylim(1.0e-4, 4.0e-3)
ax.set_yscale("log")    

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


ax = fig.add_subplot(133)

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [1.0e-4, 4.0e-3]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.85 + yy[0]
        ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)

        

ax.plot(global_props1["time"], Acc_pos1,  "-k", linewidth=2)
ax.plot(global_props1["time"], Acc_neg1,  "--k", linewidth=2)



ax.set_xlabel("time [Myr]", fontsize=15)
#ax.set_ylabel("Accretion rate [M$_{\odot}$ yr$^{-1}$]", fontsize=15)
ax.set_title("Mass Accretion, $\Delta x=0.95$ pc", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_ylim(1.0e-4, 4.0e-3)
ax.set_yscale("log")    

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


fig.tight_layout()

fig.show()

save_dir = "/home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/"
filename = Cloud_name + "_Macc"

fig.savefig("%s%s.pdf"%(save_dir, filename), format='pdf')
print("Saving Figure: %s%s.pdf"%(save_dir, filename))
Saving Figure: /home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/M8e3_Macc.pdf

Compute the difference

Plot the "error" or the difference of the cloud mass, radius and velocity dispersion for different resolutions.

Plot the difference in the mass accretion rate of the cloud.

How can I check the difference of the environment? cwhat about doing some sort of turbulent power spectrum? of the material around the cloud?


In [15]:
global_dataM405, global_propsM405   = Rd.Restore_Cloud_Evolution("M4e3", 0.5, 0, 9.8, nmin=100)
global_dataM4006, global_propsM4006 = Rd.Restore_Cloud_Evolution("M4e3", 0.06, 0, 9.8, nmin=100)
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp001.dat
Reading the File M4e3_CloudObject_snp002.dat
Reading the File M4e3_CloudObject_snp003.dat
Reading the File M4e3_CloudObject_snp004.dat
Reading the File M4e3_CloudObject_snp005.dat
Reading the File M4e3_CloudObject_snp006.dat
Reading the File M4e3_CloudObject_snp007.dat
Reading the File M4e3_CloudObject_snp008.dat
Reading the File M4e3_CloudObject_snp009.dat
Reading the File M4e3_CloudObject_snp010.dat
Reading the File M4e3_CloudObject_snp011.dat
Reading the File M4e3_CloudObject_snp012.dat
Reading the File M4e3_CloudObject_snp013.dat
Reading the File M4e3_CloudObject_snp014.dat
Reading the File M4e3_CloudObject_snp015.dat
Reading the File M4e3_CloudObject_snp016.dat
Reading the File M4e3_CloudObject_snp017.dat
Reading the File M4e3_CloudObject_snp018.dat
Reading the File M4e3_CloudObject_snp019.dat
Reading the File M4e3_CloudObject_snp020.dat
Reading the File M4e3_CloudObject_snp021.dat
Reading the File M4e3_CloudObject_snp022.dat
Reading the File M4e3_CloudObject_snp023.dat
Reading the File M4e3_CloudObject_snp024.dat
Reading the File M4e3_CloudObject_snp025.dat
Reading the File M4e3_CloudObject_snp026.dat
Reading the File M4e3_CloudObject_snp027.dat
Reading the File M4e3_CloudObject_snp028.dat
Reading the File M4e3_CloudObject_snp029.dat
Reading the File M4e3_CloudObject_snp030.dat
Reading the File M4e3_CloudObject_snp031.dat
Reading the File M4e3_CloudObject_snp032.dat
Reading the File M4e3_CloudObject_snp033.dat
Reading the File M4e3_CloudObject_snp034.dat
Reading the File M4e3_CloudObject_snp035.dat
Reading the File M4e3_CloudObject_snp036.dat
Reading the File M4e3_CloudObject_snp037.dat
Reading the File M4e3_CloudObject_snp038.dat
Reading the File M4e3_CloudObject_snp039.dat
Reading the File M4e3_CloudObject_snp040.dat
Reading the File M4e3_CloudObject_snp041.dat
Reading the File M4e3_CloudObject_snp042.dat
Reading the File M4e3_CloudObject_snp043.dat
Reading the File M4e3_CloudObject_snp044.dat
Reading the File M4e3_CloudObject_snp045.dat
Reading the File M4e3_CloudObject_snp046.dat
Reading the File M4e3_CloudObject_snp047.dat
Reading the File M4e3_CloudObject_snp048.dat
Reading the File M4e3_CloudObject_snp049.dat
Reading the File M4e3_CloudObject_snp050.dat
Reading the File M4e3_CloudObject_snp051.dat
Reading the File M4e3_CloudObject_snp052.dat
Reading the File M4e3_CloudObject_snp053.dat
Reading the File M4e3_CloudObject_snp054.dat
Reading the File M4e3_CloudObject_snp055.dat
Reading the File M4e3_CloudObject_snp056.dat
Reading the File M4e3_CloudObject_snp057.dat
Reading the File M4e3_CloudObject_snp058.dat
Reading the File M4e3_CloudObject_snp059.dat
Reading the File M4e3_CloudObject_snp060.dat
Reading the File M4e3_CloudObject_snp061.dat
Reading the File M4e3_CloudObject_snp062.dat
Reading the File M4e3_CloudObject_snp063.dat
Reading the File M4e3_CloudObject_snp064.dat
Reading the File M4e3_CloudObject_snp065.dat
Reading the File M4e3_CloudObject_snp066.dat
Reading the File M4e3_CloudObject_snp067.dat
Reading the File M4e3_CloudObject_snp068.dat
Reading the File M4e3_CloudObject_snp069.dat
Reading the File M4e3_CloudObject_snp070.dat
Reading the File M4e3_CloudObject_snp071.dat
Reading the File M4e3_CloudObject_snp072.dat
Reading the File M4e3_CloudObject_snp073.dat
Reading the File M4e3_CloudObject_snp074.dat
Reading the File M4e3_CloudObject_snp075.dat
Reading the File M4e3_CloudObject_snp076.dat
Reading the File M4e3_CloudObject_snp077.dat
Reading the File M4e3_CloudObject_snp078.dat
Reading the File M4e3_CloudObject_snp079.dat
Reading the File M4e3_CloudObject_snp080.dat
Reading the File M4e3_CloudObject_snp081.dat
Reading the File M4e3_CloudObject_snp082.dat
Reading the File M4e3_CloudObject_snp083.dat
Reading the File M4e3_CloudObject_snp084.dat
Reading the File M4e3_CloudObject_snp085.dat
Reading the File M4e3_CloudObject_snp086.dat
Reading the File M4e3_CloudObject_snp087.dat
Reading the File M4e3_CloudObject_snp088.dat
Reading the File M4e3_CloudObject_snp089.dat
Reading the File M4e3_CloudObject_snp090.dat
Reading the File M4e3_CloudObject_snp091.dat
Reading the File M4e3_CloudObject_snp092.dat
Reading the File M4e3_CloudObject_snp093.dat
Reading the File M4e3_CloudObject_snp094.dat
Reading the File M4e3_CloudObject_snp095.dat
Reading the File M4e3_CloudObject_snp096.dat
Reading the File M4e3_CloudObject_snp097.dat
Reading the File M4e3_CloudObject_snp098.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp001.dat
Reading the File M4e3_CloudObject_snp002.dat
Reading the File M4e3_CloudObject_snp003.dat
Reading the File M4e3_CloudObject_snp004.dat
Reading the File M4e3_CloudObject_snp005.dat
Reading the File M4e3_CloudObject_snp006.dat
Reading the File M4e3_CloudObject_snp007.dat
Reading the File M4e3_CloudObject_snp008.dat
Reading the File M4e3_CloudObject_snp009.dat
Reading the File M4e3_CloudObject_snp010.dat
Reading the File M4e3_CloudObject_snp011.dat
Reading the File M4e3_CloudObject_snp012.dat
Reading the File M4e3_CloudObject_snp013.dat
Reading the File M4e3_CloudObject_snp014.dat
Reading the File M4e3_CloudObject_snp015.dat
Reading the File M4e3_CloudObject_snp016.dat
Reading the File M4e3_CloudObject_snp017.dat
Reading the File M4e3_CloudObject_snp018.dat
Reading the File M4e3_CloudObject_snp019.dat
Reading the File M4e3_CloudObject_snp020.dat
Reading the File M4e3_CloudObject_snp021.dat
Reading the File M4e3_CloudObject_snp022.dat
Reading the File M4e3_CloudObject_snp023.dat
Reading the File M4e3_CloudObject_snp024.dat
Reading the File M4e3_CloudObject_snp025.dat
Reading the File M4e3_CloudObject_snp026.dat
Reading the File M4e3_CloudObject_snp027.dat
Reading the File M4e3_CloudObject_snp028.dat
Reading the File M4e3_CloudObject_snp029.dat
Reading the File M4e3_CloudObject_snp030.dat
Reading the File M4e3_CloudObject_snp031.dat
Reading the File M4e3_CloudObject_snp032.dat
Reading the File M4e3_CloudObject_snp033.dat
Reading the File M4e3_CloudObject_snp034.dat
Reading the File M4e3_CloudObject_snp035.dat
Reading the File M4e3_CloudObject_snp036.dat
Reading the File M4e3_CloudObject_snp037.dat
Reading the File M4e3_CloudObject_snp038.dat
Reading the File M4e3_CloudObject_snp039.dat
Reading the File M4e3_CloudObject_snp040.dat
Reading the File M4e3_CloudObject_snp041.dat
Reading the File M4e3_CloudObject_snp042.dat
Reading the File M4e3_CloudObject_snp043.dat
Reading the File M4e3_CloudObject_snp044.dat
Reading the File M4e3_CloudObject_snp045.dat
Reading the File M4e3_CloudObject_snp046.dat
Reading the File M4e3_CloudObject_snp047.dat
Reading the File M4e3_CloudObject_snp048.dat
Reading the File M4e3_CloudObject_snp049.dat
Reading the File M4e3_CloudObject_snp050.dat
Reading the File M4e3_CloudObject_snp051.dat
Reading the File M4e3_CloudObject_snp052.dat
Reading the File M4e3_CloudObject_snp053.dat
Reading the File M4e3_CloudObject_snp054.dat
Reading the File M4e3_CloudObject_snp055.dat
Reading the File M4e3_CloudObject_snp056.dat
Reading the File M4e3_CloudObject_snp057.dat
Reading the File M4e3_CloudObject_snp058.dat
Reading the File M4e3_CloudObject_snp059.dat
Reading the File M4e3_CloudObject_snp060.dat
Reading the File M4e3_CloudObject_snp061.dat
Reading the File M4e3_CloudObject_snp062.dat
Reading the File M4e3_CloudObject_snp063.dat
Reading the File M4e3_CloudObject_snp064.dat
Reading the File M4e3_CloudObject_snp065.dat
Reading the File M4e3_CloudObject_snp066.dat
Reading the File M4e3_CloudObject_snp067.dat
Reading the File M4e3_CloudObject_snp068.dat
Reading the File M4e3_CloudObject_snp069.dat
Reading the File M4e3_CloudObject_snp070.dat
Reading the File M4e3_CloudObject_snp071.dat
Reading the File M4e3_CloudObject_snp072.dat
Reading the File M4e3_CloudObject_snp073.dat
Reading the File M4e3_CloudObject_snp074.dat
Reading the File M4e3_CloudObject_snp075.dat
Reading the File M4e3_CloudObject_snp076.dat
Reading the File M4e3_CloudObject_snp077.dat
Reading the File M4e3_CloudObject_snp078.dat
Reading the File M4e3_CloudObject_snp079.dat
Reading the File M4e3_CloudObject_snp080.dat
Reading the File M4e3_CloudObject_snp081.dat
Reading the File M4e3_CloudObject_snp082.dat
Reading the File M4e3_CloudObject_snp083.dat
Reading the File M4e3_CloudObject_snp084.dat
Reading the File M4e3_CloudObject_snp085.dat
Reading the File M4e3_CloudObject_snp086.dat
Reading the File M4e3_CloudObject_snp087.dat
Reading the File M4e3_CloudObject_snp088.dat
Reading the File M4e3_CloudObject_snp089.dat
Reading the File M4e3_CloudObject_snp090.dat
Reading the File M4e3_CloudObject_snp091.dat
Reading the File M4e3_CloudObject_snp092.dat
Reading the File M4e3_CloudObject_snp093.dat
Reading the File M4e3_CloudObject_snp094.dat
Reading the File M4e3_CloudObject_snp095.dat
Reading the File M4e3_CloudObject_snp096.dat
Reading the File M4e3_CloudObject_snp097.dat
Reading the File M4e3_CloudObject_snp098.dat
In [16]:
n_crit006 = (3.31 / (4*0.06))**2 * 100
In [17]:
global_data_ncrit006M4, global_props_ncrit006M4 = Rd.Restore_Cloud_Evolution("M4e3", 0.06, 0, 9.8, nmin=n_crit006)
global_data_ncrit05M4, global_props_ncrit05M4 = Rd.Restore_Cloud_Evolution("M4e3", 0.5, 0, 9.8, nmin=n_crit05)
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp001.dat
Reading the File M4e3_CloudObject_snp002.dat
Reading the File M4e3_CloudObject_snp003.dat
Reading the File M4e3_CloudObject_snp004.dat
Reading the File M4e3_CloudObject_snp005.dat
Reading the File M4e3_CloudObject_snp006.dat
Reading the File M4e3_CloudObject_snp007.dat
Reading the File M4e3_CloudObject_snp008.dat
Reading the File M4e3_CloudObject_snp009.dat
Reading the File M4e3_CloudObject_snp010.dat
Reading the File M4e3_CloudObject_snp011.dat
Reading the File M4e3_CloudObject_snp012.dat
Reading the File M4e3_CloudObject_snp013.dat
Reading the File M4e3_CloudObject_snp014.dat
Reading the File M4e3_CloudObject_snp015.dat
Reading the File M4e3_CloudObject_snp016.dat
Reading the File M4e3_CloudObject_snp017.dat
Reading the File M4e3_CloudObject_snp018.dat
Reading the File M4e3_CloudObject_snp019.dat
Reading the File M4e3_CloudObject_snp020.dat
Reading the File M4e3_CloudObject_snp021.dat
Reading the File M4e3_CloudObject_snp022.dat
Reading the File M4e3_CloudObject_snp023.dat
Reading the File M4e3_CloudObject_snp024.dat
Reading the File M4e3_CloudObject_snp025.dat
Reading the File M4e3_CloudObject_snp026.dat
Reading the File M4e3_CloudObject_snp027.dat
Reading the File M4e3_CloudObject_snp028.dat
Reading the File M4e3_CloudObject_snp029.dat
Reading the File M4e3_CloudObject_snp030.dat
Reading the File M4e3_CloudObject_snp031.dat
Reading the File M4e3_CloudObject_snp032.dat
Reading the File M4e3_CloudObject_snp033.dat
Reading the File M4e3_CloudObject_snp034.dat
Reading the File M4e3_CloudObject_snp035.dat
Reading the File M4e3_CloudObject_snp036.dat
Reading the File M4e3_CloudObject_snp037.dat
Reading the File M4e3_CloudObject_snp038.dat
Reading the File M4e3_CloudObject_snp039.dat
Reading the File M4e3_CloudObject_snp040.dat
Reading the File M4e3_CloudObject_snp041.dat
Reading the File M4e3_CloudObject_snp042.dat
Reading the File M4e3_CloudObject_snp043.dat
Reading the File M4e3_CloudObject_snp044.dat
Reading the File M4e3_CloudObject_snp045.dat
Reading the File M4e3_CloudObject_snp046.dat
Reading the File M4e3_CloudObject_snp047.dat
Reading the File M4e3_CloudObject_snp048.dat
Reading the File M4e3_CloudObject_snp049.dat
Reading the File M4e3_CloudObject_snp050.dat
Reading the File M4e3_CloudObject_snp051.dat
Reading the File M4e3_CloudObject_snp052.dat
Reading the File M4e3_CloudObject_snp053.dat
Reading the File M4e3_CloudObject_snp054.dat
Reading the File M4e3_CloudObject_snp055.dat
Reading the File M4e3_CloudObject_snp056.dat
Reading the File M4e3_CloudObject_snp057.dat
Reading the File M4e3_CloudObject_snp058.dat
Reading the File M4e3_CloudObject_snp059.dat
Reading the File M4e3_CloudObject_snp060.dat
Reading the File M4e3_CloudObject_snp061.dat
Reading the File M4e3_CloudObject_snp062.dat
Reading the File M4e3_CloudObject_snp063.dat
Reading the File M4e3_CloudObject_snp064.dat
Reading the File M4e3_CloudObject_snp065.dat
Reading the File M4e3_CloudObject_snp066.dat
Reading the File M4e3_CloudObject_snp067.dat
Reading the File M4e3_CloudObject_snp068.dat
Reading the File M4e3_CloudObject_snp069.dat
Reading the File M4e3_CloudObject_snp070.dat
Reading the File M4e3_CloudObject_snp071.dat
Reading the File M4e3_CloudObject_snp072.dat
Reading the File M4e3_CloudObject_snp073.dat
Reading the File M4e3_CloudObject_snp074.dat
Reading the File M4e3_CloudObject_snp075.dat
Reading the File M4e3_CloudObject_snp076.dat
Reading the File M4e3_CloudObject_snp077.dat
Reading the File M4e3_CloudObject_snp078.dat
Reading the File M4e3_CloudObject_snp079.dat
Reading the File M4e3_CloudObject_snp080.dat
Reading the File M4e3_CloudObject_snp081.dat
Reading the File M4e3_CloudObject_snp082.dat
Reading the File M4e3_CloudObject_snp083.dat
Reading the File M4e3_CloudObject_snp084.dat
Reading the File M4e3_CloudObject_snp085.dat
Reading the File M4e3_CloudObject_snp086.dat
Reading the File M4e3_CloudObject_snp087.dat
Reading the File M4e3_CloudObject_snp088.dat
Reading the File M4e3_CloudObject_snp089.dat
Reading the File M4e3_CloudObject_snp090.dat
Reading the File M4e3_CloudObject_snp091.dat
Reading the File M4e3_CloudObject_snp092.dat
Reading the File M4e3_CloudObject_snp093.dat
Reading the File M4e3_CloudObject_snp094.dat
Reading the File M4e3_CloudObject_snp095.dat
Reading the File M4e3_CloudObject_snp096.dat
Reading the File M4e3_CloudObject_snp097.dat
Reading the File M4e3_CloudObject_snp098.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp000.dat
Reading the File M4e3_CloudObject_snp001.dat
Reading the File M4e3_CloudObject_snp002.dat
Reading the File M4e3_CloudObject_snp003.dat
Reading the File M4e3_CloudObject_snp004.dat
Reading the File M4e3_CloudObject_snp005.dat
Reading the File M4e3_CloudObject_snp006.dat
Reading the File M4e3_CloudObject_snp007.dat
Reading the File M4e3_CloudObject_snp008.dat
Reading the File M4e3_CloudObject_snp009.dat
Reading the File M4e3_CloudObject_snp010.dat
Reading the File M4e3_CloudObject_snp011.dat
Reading the File M4e3_CloudObject_snp012.dat
Reading the File M4e3_CloudObject_snp013.dat
Reading the File M4e3_CloudObject_snp014.dat
Reading the File M4e3_CloudObject_snp015.dat
Reading the File M4e3_CloudObject_snp016.dat
Reading the File M4e3_CloudObject_snp017.dat
Reading the File M4e3_CloudObject_snp018.dat
Reading the File M4e3_CloudObject_snp019.dat
Reading the File M4e3_CloudObject_snp020.dat
Reading the File M4e3_CloudObject_snp021.dat
Reading the File M4e3_CloudObject_snp022.dat
Reading the File M4e3_CloudObject_snp023.dat
Reading the File M4e3_CloudObject_snp024.dat
Reading the File M4e3_CloudObject_snp025.dat
Reading the File M4e3_CloudObject_snp026.dat
Reading the File M4e3_CloudObject_snp027.dat
Reading the File M4e3_CloudObject_snp028.dat
Reading the File M4e3_CloudObject_snp029.dat
Reading the File M4e3_CloudObject_snp030.dat
Reading the File M4e3_CloudObject_snp031.dat
Reading the File M4e3_CloudObject_snp032.dat
Reading the File M4e3_CloudObject_snp033.dat
Reading the File M4e3_CloudObject_snp034.dat
Reading the File M4e3_CloudObject_snp035.dat
Reading the File M4e3_CloudObject_snp036.dat
Reading the File M4e3_CloudObject_snp037.dat
Reading the File M4e3_CloudObject_snp038.dat
Reading the File M4e3_CloudObject_snp039.dat
Reading the File M4e3_CloudObject_snp040.dat
Reading the File M4e3_CloudObject_snp041.dat
Reading the File M4e3_CloudObject_snp042.dat
Reading the File M4e3_CloudObject_snp043.dat
Reading the File M4e3_CloudObject_snp044.dat
Reading the File M4e3_CloudObject_snp045.dat
Reading the File M4e3_CloudObject_snp046.dat
Reading the File M4e3_CloudObject_snp047.dat
Reading the File M4e3_CloudObject_snp048.dat
Reading the File M4e3_CloudObject_snp049.dat
Reading the File M4e3_CloudObject_snp050.dat
Reading the File M4e3_CloudObject_snp051.dat
Reading the File M4e3_CloudObject_snp052.dat
Reading the File M4e3_CloudObject_snp053.dat
Reading the File M4e3_CloudObject_snp054.dat
Reading the File M4e3_CloudObject_snp055.dat
Reading the File M4e3_CloudObject_snp056.dat
Reading the File M4e3_CloudObject_snp057.dat
Reading the File M4e3_CloudObject_snp058.dat
Reading the File M4e3_CloudObject_snp059.dat
Reading the File M4e3_CloudObject_snp060.dat
Reading the File M4e3_CloudObject_snp061.dat
Reading the File M4e3_CloudObject_snp062.dat
Reading the File M4e3_CloudObject_snp063.dat
Reading the File M4e3_CloudObject_snp064.dat
Reading the File M4e3_CloudObject_snp065.dat
Reading the File M4e3_CloudObject_snp066.dat
Reading the File M4e3_CloudObject_snp067.dat
Reading the File M4e3_CloudObject_snp068.dat
Reading the File M4e3_CloudObject_snp069.dat
Reading the File M4e3_CloudObject_snp070.dat
Reading the File M4e3_CloudObject_snp071.dat
Reading the File M4e3_CloudObject_snp072.dat
Reading the File M4e3_CloudObject_snp073.dat
Reading the File M4e3_CloudObject_snp074.dat
Reading the File M4e3_CloudObject_snp075.dat
Reading the File M4e3_CloudObject_snp076.dat
Reading the File M4e3_CloudObject_snp077.dat
Reading the File M4e3_CloudObject_snp078.dat
Reading the File M4e3_CloudObject_snp079.dat
Reading the File M4e3_CloudObject_snp080.dat
Reading the File M4e3_CloudObject_snp081.dat
Reading the File M4e3_CloudObject_snp082.dat
Reading the File M4e3_CloudObject_snp083.dat
Reading the File M4e3_CloudObject_snp084.dat
Reading the File M4e3_CloudObject_snp085.dat
Reading the File M4e3_CloudObject_snp086.dat
Reading the File M4e3_CloudObject_snp087.dat
Reading the File M4e3_CloudObject_snp088.dat
Reading the File M4e3_CloudObject_snp089.dat
Reading the File M4e3_CloudObject_snp090.dat
Reading the File M4e3_CloudObject_snp091.dat
Reading the File M4e3_CloudObject_snp092.dat
Reading the File M4e3_CloudObject_snp093.dat
Reading the File M4e3_CloudObject_snp094.dat
Reading the File M4e3_CloudObject_snp095.dat
Reading the File M4e3_CloudObject_snp096.dat
Reading the File M4e3_CloudObject_snp097.dat
Reading the File M4e3_CloudObject_snp098.dat
In [18]:
Mass_ratio_resolved006M4 = np.array(global_props_ncrit006M4["mass"]) / np.array(global_propsM4006["mass"])
Mass_ratio_resolved05M4  = np.array(global_props_ncrit05M4["mass"]) / np.array(global_propsM405["mass"])

# Locate the Point where the fragmentation and gravitational collapse is unresolved.
for i in range(len(Mass_ratio_resolved006M4)):
    if Mass_ratio_resolved006M4[i] >= 0.50:
        print("Cloud %s is unresolved after %i snapshots"%("M4e3", i))
        unresolved_index006M4 = i
        break
        
# Locate the Point where the fragmentation and gravitational collapse is unresolved.
for i in range(len(Mass_ratio_resolved05M4)):
    if Mass_ratio_resolved05M4[i] >= 0.50:
        print("Cloud %s is unresolved after %i snapshots"%("M4e3", i))
        unresolved_index05M4 = i
        break
Cloud M4e3 is unresolved after 59 snapshots
Cloud M4e3 is unresolved after 36 snapshots
In [19]:
Mass_accretionM4006 = np.zeros_like(global_propsM4006["time"])
Mass_accretionM405 = np.zeros_like(global_propsM405["time"])

for i in range(len(Mass_accretionM4006)-2):

    j = i+1
    
    Mass_accretionM4006[j] = (global_propsM4006["mass"][j+1] - global_propsM4006["mass"][j-1]) / Msun / \
                        ((global_propsM4006["time"][j+1] - global_propsM4006["time"][j-1])*1.0e6)

    Mass_accretionM405[j] = (global_propsM405["mass"][j+1] - global_propsM405["mass"][j-1]) / Msun / \
                        ((global_propsM405["time"][j+1] - global_propsM405["time"][j-1])*1.0e6)

        
Mass_accretionM4006[-1] = Mass_accretionM4006[-2]
Mass_accretionM405[-1] = Mass_accretionM405[-2]
In [20]:
print np.mean(Mass_accretionM4006)
print np.mean(Mass_accretionM405)
0.0003887159039
0.000353783531294
In [34]:
fig = plt.figure(figsize=(18, 12))

# Cloud Mass
################################################
ax = fig.add_subplot(221)

min_mass = np.min(global_propsM4006["mass"]) 
max_mass = np.max(global_propsM4006["mass"]) 

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [min_mass/Msun-200, max_mass/Msun+100]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        #ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.95 + yy[0]
        #ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)

ax.plot(global_propsM4006["time"], np.array(global_propsM4006["mass"])/Msun,  "-k", linewidth=2, label="$\Delta x=0.06$ pc")
ax.plot(global_propsM405["time"], np.array(global_propsM405["mass"])/Msun,  "--k", linewidth=2, label="$\Delta x=0.47$ pc")


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Mass [M$_{\odot}$]", fontsize=15)
ax.set_title("Cloud Mass", fontsize=15)

ax.legend(loc=4, fontsize=20)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 


ax.set_ylim(min_mass/Msun-200, max_mass/Msun+100)
ax.set_xlim(global_propsM4006["time"][0], global_propsM4006["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

ax.plot([global_propsM4006["time"][unresolved_index006M4],global_propsM4006["time"][unresolved_index006M4]], yy, "-k", linewidth=3)
ax.plot([global_propsM405["time"][unresolved_index05M4],global_propsM405["time"][unresolved_index05M4]], yy, "--k", linewidth=3)

Lx =  global_propsM4006["time"][unresolved_index006M4]
Ly =  (yy[1] - yy[0])
ax.text(1.01*Lx, yy[0] + 0.5*Ly, "Unresolved\ncollapse\n$\Delta x=0.06$ pc", fontsize=13)

Lx =  global_propsM405["time"][unresolved_index05M4]
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


# Cloud Radius
################################################
ax = fig.add_subplot(223)

min_rad = 2.5
max_rad = 6 

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [min_rad, max_rad]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        #ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.95 + yy[0]
        #ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Radius [pc]", fontsize=15)
ax.set_title("Cloud Radius", fontsize=15)


ax.plot(global_propsM4006["time"], np.array(global_propsM4006["radius"])/ppc,  "-k", linewidth=2, label="$\Delta x=0.06$ pc")
ax.plot(global_propsM405["time"], np.array(global_propsM405["radius"])/ppc,  "--k", linewidth=2, label="$\Delta x=0.47$ pc")

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)

ax.set_ylim(min_rad, max_rad)
ax.set_xlim(global_propsM4006["time"][0], global_propsM4006["time"][-1])

#ax.legend(loc=0, fontsize=20)

ax.plot([global_propsM4006["time"][unresolved_index006M4],global_propsM4006["time"][unresolved_index006M4]], yy, "-k", linewidth=3)
ax.plot([global_propsM405["time"][unresolved_index05M4],  global_propsM405["time"][unresolved_index05M4]], yy, "--k", linewidth=3)

Lx =  global_propsM4006["time"][unresolved_index006M4]
Ly =  (yy[1] - yy[0])
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.06$ pc", fontsize=13)

Lx =  global_propsM405["time"][unresolved_index05M4]
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


# Virial Parameter
################################################
ax = fig.add_subplot(222)

ax.plot(global_propsM4006["time"], np.array(global_propsM4006["alpha_virial"]), "-k", linewidth=2)
ax.plot(global_propsM405["time"], np.array(global_propsM405["alpha_virial"]), "--k", linewidth=2)


ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("alpha virial", fontsize=15)
ax.set_title("Virial Parameter", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_xlim(global_propsM4006["time"][0], global_propsM4006["time"][-1])

min_virial = np.min(global_props01["alpha_virial"]) 
max_virial = np.max(global_props01["alpha_virial"])
Ly       =  (max_virial - min_virial ) 

ax.set_ylim(1.0e-1, 5)

ax.set_yscale("log")

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)

yy = [min_virial*0.1, max_virial]

ax.plot([global_propsM4006["time"][unresolved_index006M4],global_propsM4006["time"][unresolved_index006M4]], yy, "-k", linewidth=3)
ax.plot([global_propsM405["time"][unresolved_index05M4],global_propsM405["time"][unresolved_index05M4]], yy, "--k", linewidth=3)

Lx =  global_propsM4006["time"][unresolved_index006M4]
Ly =  (yy[1] - yy[0])
ax.text(1.01*Lx, yy[0] + 0.4*Ly, "Unresolved\ncollapse\n$\Delta x=0.06$ pc", fontsize=13)

Lx =  global_propsM405["time"][unresolved_index05M4]
ax.text(1.01*Lx, yy[0] + 0.4*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)



# Total velocity dispersion
################################################
ax = fig.add_subplot(224)


ax.plot(global_propsM4006["time"], np.array(global_propsM4006["vel_disp_total"])/1.0e5,  "-k", linewidth=2)
ax.plot(global_propsM405["time"], np.array(global_propsM405["vel_disp_total"])/1.0e5,  "--k", linewidth=2 )

ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("$\sigma_{tot}$ [km s$^{-1}$]", fontsize=15)
ax.set_title("Total velocity dispersion", fontsize=15)


ax.set_ylim(0.2, 2.0)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_xlim(global_props01["time"][0], global_props01["time"][-1])


start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.tick_params(labelsize=14)

yy = [0.2, 2.0]

ax.plot([global_propsM4006["time"][unresolved_index006M4],global_propsM4006["time"][unresolved_index006M4]], yy, "-k", linewidth=3)
ax.plot([global_propsM405["time"][unresolved_index05M4],global_propsM405["time"][unresolved_index05M4]], yy, "--k", linewidth=3)

Lx =  global_propsM4006["time"][unresolved_index006M4]
Ly =  (yy[1] - yy[0])
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.06$ pc", fontsize=13)

Lx =  global_propsM405["time"][unresolved_index05M4]
ax.text(1.01*Lx, yy[0] + 0.85*Ly, "Unresolved\ncollapse\n$\Delta x=0.47$ pc", fontsize=13)

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)



fig.tight_layout()

fig.show()

save_dir = "/home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/"
filename = "M4e3_Mass-Radius-alpha-sigma"

fig.savefig("%s%s.pdf"%(save_dir, filename), format='pdf')
print("Saving Figure: %s%s.pdf"%(save_dir, filename))
Saving Figure: /home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/M4e3_Mass-Radius-alpha-sigma.pdf
In [30]:
fig = plt.figure(figsize=(14, 6))

# Mass accretion rate.
################################################

ax = fig.add_subplot(121)

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [1.0e-4, 4.0e-3]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.85 + yy[0]
        ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)


Acc_posM4006, Acc_negM4006 = np.zeros_like(Mass_accretionM4006), np.zeros_like(Mass_accretionM4006)
Acc_posM405, Acc_negM405 = np.zeros_like(Mass_accretionM405), np.zeros_like(Mass_accretionM405)

for i in range(len(Acc_negM4006)):
    if Mass_accretionM4006[i] > 0:
        Acc_posM4006[i] = Mass_accretionM4006[i]
        Acc_negM4006[i] = 1.0e-99

        Acc_posM405[i] = Mass_accretionM405[i]
        Acc_negM405[i] = 1.0e-99
        
    else:
        Acc_negM4006[i] = np.abs(Mass_accretionM4006[i])
        Acc_posM4006[i] = 1.0e-99

        Acc_negM405[i] = np.abs(Mass_accretionM405[i])
        Acc_posM405[i] = 1.0e-99
        

        
ax.plot(global_propsM4006["time"], Acc_posM4006,  "-k", linewidth=2)
ax.plot(global_propsM4006["time"], Acc_negM4006,  "--k", linewidth=2)



ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Accretion rate [M$_{\odot}$ yr$^{-1}$]", fontsize=15)
ax.set_title("Mass Accretion, $\Delta x=0.06$ pc", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_ylim(1.0e-4, 4.0e-3)
ax.set_yscale("log")    

ax.set_xlim(global_propsM4006["time"][0], global_propsM4006["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)

# ====================================================================================

ax = fig.add_subplot(122)

for sn in range(len(Nearby_SN["time"])):
    # Give the SN line a width with respect to the distance to the cloud.
    lwidth = -(1./25.)*Nearby_SN["distance"][sn] + 4
    yy = [1.0e-4, 4.0e-3]
    lalpha = -(1/100.)*Nearby_SN["distance"][sn] + 2.0
    if lalpha > 1: lalpha = 1
    
    if (Nearby_SN["distance"][sn] < 95):
        ax.plot([Nearby_SN["time"][sn], Nearby_SN["time"][sn]], yy, '--b', linewidth=lwidth, alpha=lalpha)
        ytxt = (yy[1] - yy[0])*0.85 + yy[0]
        ax.text(Nearby_SN["time"][sn]+0.05, ytxt, "%.2f pc" %(Nearby_SN["distance"][sn]), rotation=90, fontsize=12)

        

ax.plot(global_propsM405["time"], Acc_posM405,  "-k", linewidth=2)
ax.plot(global_propsM405["time"], Acc_negM405,  "--k", linewidth=2)



ax.set_xlabel("time [Myr]", fontsize=15)
ax.set_ylabel("Accretion rate [M$_{\odot}$ yr$^{-1}$]", fontsize=15)
ax.set_title("Mass Accretion, $\Delta x=0.47$ pc", fontsize=15)

for tick in ax.xaxis.get_major_ticks():
    tick.label.set_fontsize(14) 
for tick in ax.yaxis.get_major_ticks():
    tick.label.set_fontsize(14) 

ax.set_ylim(1.0e-4, 4.0e-3)
ax.set_yscale("log")    

ax.set_xlim(global_propsM405["time"][0], global_propsM405["time"][-1])

start, end = ax.get_xlim()
ax.xaxis.set_ticks(np.arange(start, end, 1))

# We change the fontsize of minor ticks label 
ax.tick_params(axis='both', which='major', length=8, width=2, labelsize=15)
ax.tick_params(axis='both', which='minor', length=4, width=1.5, labelsize=10)


fig.tight_layout()

fig.show()

save_dir = "/home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/"
filename = "M4e3_Macc"

fig.savefig("%s%s.pdf"%(save_dir, filename), format='pdf')
print("Saving Figure: %s%s.pdf"%(save_dir, filename))
Saving Figure: /home/jcibanezm/codes/StratBox/AccretingClouds_Paper/Plots/ResolutionStudy/M4e3_Macc.pdf