cavity.r_0 = envelope.rmax
cavity.rho_0 = 5e4 * 3.32e-24
cavity.rho_exp = 0.
cavity.dust = 'kmh_lite.hdf5'

# Use raytracing to improve s/n of thermal/source emission
m.set_raytracing(True)

# Use the modified random walk
m.set_mrw(True, gamma=2.)

# Set up grid
m.set_spherical_polar_grid_auto(399, 199, 1)

# Set up SED
sed = m.add_peeled_images(sed=True, image=False)
sed.set_viewing_angles(np.linspace(0., 90., 10), np.repeat(45., 10))
sed.set_wavelength_range(150, 0.02, 2000.)

# Set number of photons
m.set_n_photons(initial=1e6, imaging=1e6,
                raytracing_sources=1e4, raytracing_dust=1e6)

# Set number of temperature iterations and convergence criterion
m.set_n_initial_iterations(10)
m.set_convergence(True, percentile=99.0, absolute=2.0, relative=1.1)

# Write out file
m.write('class1_example.rtin')
m.run('class1_example.rtout', mpi=True)
Beispiel #2
0
disk.beta = 1.25
disk.dust = 'kmh_lite.hdf5'

# Use raytracing to improve s/n of thermal/source emission
m.set_raytracing(True)

# Use the modified random walk
m.set_mrw(True, gamma=2.)

# Set up grid
m.set_spherical_polar_grid_auto(399, 199, 1)

# Set up SED for 10 viewing angles
sed = m.add_peeled_images(sed=True, image=False)
sed.set_viewing_angles(np.linspace(0., 90., 10), np.repeat(45., 10))
sed.set_wavelength_range(150, 0.02, 2000.)
sed.set_track_origin('basic')

# Set number of photons
m.set_n_photons(initial=1e5,
                imaging=1e6,
                raytracing_sources=1e4,
                raytracing_dust=1e6)

# Set number of temperature iterations
m.set_n_initial_iterations(5)

# Write out file
m.write('class2_sed.rtin')
m.run('class2_sed.rtout', mpi=True)
# Set up grid
m.set_spherical_polar_grid_auto(400, 100, 1)

# Don't compute temperatures
m.set_n_initial_iterations(0)

# Don't re-emit photons
m.set_kill_on_absorb(True)

# Use raytracing (only important for source here, since no dust emission)
m.set_raytracing(True)

# Compute images using monochromatic radiative transfer
m.set_monochromatic(True, wavelengths=[1.])

# Set up image
i = m.add_peeled_images()
i.set_image_limits(-13 * rsun, 13 * rsun, -13. * rsun, 13 * rsun)
i.set_image_size(256, 256)
i.set_viewing_angles([60.], [20.])
i.set_wavelength_range(1, 1, 1)

# Set number of photons
m.set_n_photons(imaging_sources=10000000, imaging_dust=0,
                raytracing_sources=100000, raytracing_dust=0)

# Write out the model and run it in parallel
m.write('pure_scattering.rtin')
m.run('pure_scattering.rtout', mpi=True)
Beispiel #4
0
def ShellThree_Only(dust_file_name, fnu, nu, stellar_luminoisity, stellar_temperature,  stellar_radius, total_shell_mass, uant_distance, expansion_velocity, MaxCSE_outer_rad, Photon_Number, CPU_Number):

	# Initalize the model
	model = AnalyticalYSOModel() #We use the YSO model with modified parameters to match an AGB star with a detached shell

	# Set the stellar parameters
	model.star.spectrum = (nu, fnu)
	model.star.luminosity = stellar_luminoisity
	#model.star.mass = 2 * msun #Guesstimate 1.3 - 3 Msun #Not needed for RT modelling normally. Very difficult to estimate.
	model.star.radius = stellar_radius


	#Power-law spherically symmetric envelope - Only Detached Shell - Need to add constant outflow envelope on top of this to account for the ML after the thermal pulse. 
	envelope_shell = model.add_power_law_envelope()
	envelope_shell.mass = total_shell_mass          
	envelope_shell.rmin = (41.5 * uant_distance) * au          # Shell 3 inner radius converted to au - from GD+2001&2003 AND M2010
	envelope_shell.rmax = (44.5 * uant_distance) * au          # Shell 3 outer radius converted to au - from GD+2001&2003 AND M2010
	envelope_shell.r_0 = envelope_shell.rmin
	envelope_shell.power = -2                        # Radial power #Constant Outflow envelope
	envelope_shell.dust =  dust_file_name #Using a standard Hyperion Dust model. Needs to be modified a lot for U Ant

	envelope_CSE_Max = (MaxCSE_outer_rad * uant_distance) * au    # Outer radius- estimating the total emission will be ~ this radius - pre&post thermal pulse. Units = cm


	# Set up grid to run the model on
	model.set_spherical_polar_grid_auto(100, 1, 1) #(n_r, n_theta, n_phi) - in a spherical envelope theta and phi are uniform and 1. n_r = number of r radii to seperate the grid to. 


	# Use raytracing to improve s/n of thermal/source emission
	model.set_raytracing(raytracing=True)

	# Set up SED - Get SED output
	sed = model.add_peeled_images(sed=True, image=False)
	sed.set_uncertainties(uncertainties=True)
	sed.set_viewing_angles([45], [45]) #(np.linspace(0., 90., 10), np.repeat(45., 10)) #Veiw the source at 45degrees from the pole and theta = 45
	sed.set_wavelength_range(100, 0.3, 1200.) #(n_wav, wav_min, wav_max) #Get the SED from 1micron to 2000micron in 100 wavelengths

	#Set up Image - Get image output - RT calculated for bins of wavelengths - PACS 70
	image_70 = model.add_peeled_images(sed=False, image=True)
	image_70.set_uncertainties(uncertainties=True)
	image_70.set_viewing_angles([45], [45]) #(np.linspace(0., 90., 10), np.repeat(45., 10)) #Veiw the source at 45degrees from the pole and theta = 45
	image_70.set_wavelength_range(30, 60, 90) #(n_wav, wav_min, wav_max) - PACS 70 filter profile limits 60 - 90 and get 30 image cube to get images at ~1 micron per image 
	image_70.set_image_size(400, 400) #Size of image in pixels
	image_70.set_image_limits(-1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max, -1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max)

	#Set up Image - Get image output - RT calculated for bins of wavelengths - PACS 160
	image_160 = model.add_peeled_images(sed=False, image=True)
	image_160.set_uncertainties(uncertainties=True)
	image_160.set_viewing_angles([45], [45]) #(np.linspace(0., 90., 10), np.repeat(45., 10)) #Veiw the source at 45degrees from the pole and theta = 45
	image_160.set_wavelength_range(30, 130, 220) #(n_wav, wav_min, wav_max) - PACS 160 filter profile limits 130 - 220 and get 30 image cube to get images at ~3 micron per image  
	image_160.set_image_size(400, 400) #Size of image in pixels
	image_160.set_image_limits(-1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max, -1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max)

	#Set up Image - Get image output - RT calculated for bins of wavelengths - SCUBA-2 450
	image_450 = model.add_peeled_images(sed=False, image=True)
	image_450.set_uncertainties(uncertainties=True)
	image_450.set_viewing_angles([45], [45]) #(np.linspace(0., 90., 10), np.repeat(45., 10)) #Veiw the source at 45degrees from the pole and theta = 45
	image_450.set_wavelength_range(30, 410, 480) #(n_wav, wav_min, wav_max) -  - SCUBA-2 450 filter profile limits 790 - 940 and get 30 image cube to get images at ~2 micron per image 
	image_450.set_image_size(400, 400) #Size of image in pixels
	image_450.set_image_limits(-1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max, -1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max)

	#Set up Image - Get image output - RT calculated for bins of wavelengths - SCUBA-2 850
	image_850 = model.add_peeled_images(sed=False, image=True)
	image_850.set_uncertainties(uncertainties=True)
	image_850.set_viewing_angles([45], [45]) #(np.linspace(0., 90., 10), np.repeat(45., 10)) #Veiw the source at 45degrees from the pole and theta = 45
	image_850.set_wavelength_range(30, 790, 940) #(n_wav, wav_min, wav_max) - SCUBA-2 850 filter profile limits 790 - 940 and get 30 image cube to get images at ~5 micron per image 
	image_850.set_image_size(400, 400) #Size of image in pixels
	image_850.set_image_limits(-1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max, -1.5 * envelope_CSE_Max, 1.5 * envelope_CSE_Max)


	# Set number of photons
	model.set_n_photons(initial=Photon_Number, imaging=Photon_Number, raytracing_sources=Photon_Number, raytracing_dust=Photon_Number)

	# Set number of temperature iterations and convergence criterion
	model.set_n_initial_iterations(5)
	model.set_convergence(True, percentile=99.0, absolute=2.0, relative=1.1)

	# Write out file
	Input_ShellThree_Only = 'Model_ShellThree_Only.rtin' #File which saves all the input above so that fortran can run internally for RT modelling
	Output_ShellThree_Only = 'Model_ShellThree_Only.rtout'
	
	model.write(Input_ShellThree_Only)
	model.run(Output_ShellThree_Only, mpi=True, n_processes=CPU_Number)

	return Input_ShellThree_Only, Output_ShellThree_Only
Beispiel #5
0
#dust
    disk.dust = 'www003.hdf5'
    envelope.dust = 'kmh.hdf5'
#cavity.dust = 'kmh_hdf5'

#coordinates
    n_r = 200
    n_theta = 200
    n_phi = 1
    m.set_spherical_polar_grid_auto(n_r, n_theta, n_phi)


#viewing angles
    image = m.add_peeled_images(image=False)
# Set number of viewing angles
    n_view = 10
# Generate the viewing angles
    theta = np.linspace(0., 90., n_view)
    phi = np.repeat(45., n_view)
# Set the viewing angles
    image.set_viewing_angles(theta, phi)
#sed interval
    n_wav=250
    wav_min=0.1
    wav_max=1000
    image.set_wavelength_range(n_wav, wav_min, wav_max)

#write out hyperion input
    m.write('loop_' + str(j) + '.rtin')
    m.run('loop_' + str(j) + '.rtout',mpi=True,n_processes=2)
Beispiel #6
0
# Set up grid
m.set_spherical_polar_grid_auto(400, 100, 1)

# Don't compute temperatures
m.set_n_initial_iterations(0)

# Don't re-emit photons
m.set_kill_on_absorb(True)

# Use raytracing (only important for source here, since no dust emission)
m.set_raytracing(True)

# Compute images using monochromatic radiative transfer
m.set_monochromatic(True, wavelengths=[1.0])

# Set up image
i = m.add_peeled_images()
i.set_image_limits(-13 * rsun, 13 * rsun, -13.0 * rsun, 13 * rsun)
i.set_image_size(256, 256)
i.set_viewing_angles([60.0], [20.0])
i.set_wavelength_index_range(1, 1)
i.set_stokes(True)

# Set number of photons
m.set_n_photons(imaging_sources=10000000, imaging_dust=0, raytracing_sources=100000, raytracing_dust=0)

# Write out the model and run it in parallel
m.write("pure_scattering.rtin")
m.run("pure_scattering.rtout", mpi=True)
Beispiel #7
0
# Use raytracing to improve s/n of thermal/source emission
m.set_raytracing(True)

# Use the modified random walk
m.set_mrw(True, gamma=2.)

# Set up grid
m.set_spherical_polar_grid_auto(399, 199, 1)

# Set up SED
sed = m.add_peeled_images(sed=True, image=False)
n_view = 19
sed.set_viewing_angles(np.linspace(0., 90., n_view), np.repeat(45., n_view))
sed.set_wavelength_range(150, 0.02, 2000.)
sed.set_stokes(True)
sed.set_track_origin('detailed')

# Set number of photons
m.set_n_photons(initial=1e6,
                imaging=1e6,
                raytracing_sources=1e4,
                raytracing_dust=1e6)

# Set number of temperature iterations and convergence criterion
m.set_n_initial_iterations(10)
m.set_convergence(True, percentile=99.0, absolute=2.0, relative=1.1)

# Write out file
m.write('AATau_example.rtin')
m.run('AATau_example.rtout', mpi=True)
Beispiel #8
0
cavity.rho_exp = 0.
cavity.dust = 'kmh_lite.hdf5'

# Use raytracing to improve s/n of thermal/source emission
m.set_raytracing(True)

# Use the modified random walk
m.set_mrw(True, gamma=2.)

# Set up grid
m.set_spherical_polar_grid_auto(399, 199, 1)

# Set up SED
sed = m.add_peeled_images(sed=True, image=False)
sed.set_viewing_angles(np.linspace(0., 90., 10), np.repeat(45., 10))
sed.set_wavelength_range(150, 0.02, 2000.)

# Set number of photons
m.set_n_photons(initial=1e6,
                imaging=1e6,
                raytracing_sources=1e4,
                raytracing_dust=1e6)

# Set number of temperature iterations and convergence criterion
m.set_n_initial_iterations(10)
m.set_convergence(True, percentile=99.0, absolute=2.0, relative=1.1)

# Write out file
m.write('class1_example.rtin')
m.run('class1_example.rtout', mpi=True)
Beispiel #9
0
m.star.luminosity = lsun

# Set up a simple flared disk
d = m.add_flared_disk()
d.mass = 0.001 * msun
d.rmin = 0.1 * au
d.rmax = 100. * au
d.p = -1
d.beta = 1.25
d.h_0 = 0.01 * au
d.r_0 = au
d.dust = 'kmh_lite.hdf5'

# Specify that the specific energy and density are needed
m.conf.output.output_specific_energy = 'last'
m.conf.output.output_density = 'last'

# Set the number of photons
m.set_n_photons(initial=1000000, imaging=0)

# Set up the grid
m.set_spherical_polar_grid_auto(400, 300, 1)

# Use MRW and PDA
m.set_mrw(True)
m.set_pda(True)

# Write output and run model
m.write('quantity_spherical.rtin')
m.run('quantity_spherical.rtout', mpi=True)
Beispiel #10
0
disk.r_0 = m.star.radius
disk.h_0 = 0.01 * disk.r_0
disk.p = -1.0
disk.beta = 1.25
disk.dust = "kmh_lite.hdf5"

# Use raytracing to improve s/n of thermal/source emission
m.set_raytracing(True)

# Use the modified random walk
m.set_mrw(True, gamma=2.0)

# Set up grid
m.set_spherical_polar_grid_auto(399, 199, 1)

# Set up SED for 10 viewing angles
sed = m.add_peeled_images(sed=True, image=False)
sed.set_viewing_angles(np.linspace(0.0, 90.0, 10), np.repeat(45.0, 10))
sed.set_wavelength_range(150, 0.02, 2000.0)
sed.set_track_origin("basic")

# Set number of photons
m.set_n_photons(initial=1e5, imaging=1e6, raytracing_sources=1e4, raytracing_dust=1e6)

# Set number of temperature iterations
m.set_n_initial_iterations(5)

# Write out file
m.write("class2_sed.rtin")
m.run("class2_sed.rtout", mpi=True)