当前位置: 首页>>代码示例>>Python>>正文


Python Model.read方法代码示例

本文整理汇总了Python中hyperion.model.Model.read方法的典型用法代码示例。如果您正苦于以下问题:Python Model.read方法的具体用法?Python Model.read怎么用?Python Model.read使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在hyperion.model.Model的用法示例。


在下文中一共展示了Model.read方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setup_model

# 需要导入模块: from hyperion.model import Model [as 别名]
# 或者: from hyperion.model.Model import read [as 别名]
# Resolution in pc:
cli.resolution          = 100.0

# Photons per grid cell:
cli.photons_temperature = 1
cli.photons_raytracing  = 1
cli.photons_imaging     = 1

for cli.case in [1, 2]:
    for cli.opticaldepth in [0.256434, 1.28217, 6.41084]:
        for cli.mode in ["temperature", "images", "seds"]:
            
            # Setup step:
            setup_model(cli);
            
            # Compute step:
            file = filename(cli, cli.mode)
            model = Model.read(file+".rtin")
            model.write("temp.rtin")
            model.run(filename=file+".rtout", logfile=file+".hyout", overwrite=True)
            
            # Plotting step:
            #TODO: if(cli.mode == "temperature"): visualize_setup + visualize_results => plot_setup
            if(cli.mode != "temperature"):
                plot_results(cli);
            
            # Export to fits format:
            if(cli.mode == "images"):
                export_to_fits(cli);
开发者ID:hyperion-rt,项目名称:hyperion-trust,代码行数:31,代码来源:run_all.py

示例2:

# 需要导入模块: from hyperion.model import Model [as 别名]
# 或者: from hyperion.model.Model import read [as 别名]
import glob

import numpy as np

from hyperion.model import Model
from hyperion.dust import SphericalDust
from hyperion.util.constants import pc

import yaml
settings = yaml.load(open('settings.yml'))
 
WAV = np.logspace(-1, 3, 45)

for model_path in glob.glob(os.path.join('models', '*_temperature.rtout')):

    m = Model.read(model_path, only_initial=False)

    m.set_n_initial_iterations(0)

    del m.n_photons['initial']
    del m.n_photons['last']

    i = m.add_peeled_images(sed=True, image=False)
    i.set_viewing_angles([0., 30., 60., 90., 120., 150., 180.],
                         [0., 0., 0., 0., 0., 0., 0.])
    i.set_track_origin('basic')

    i = m.add_peeled_images(sed=True, image=False)
    i.set_viewing_angles([0., 30., 60., 90., 120., 150., 180.],
                         [0., 0., 0., 0., 0., 0., 0.])
    i.set_track_origin('basic')
开发者ID:hyperion-rt,项目名称:hyperion-trust,代码行数:33,代码来源:setup_seds.py

示例3:

# 需要导入模块: from hyperion.model import Model [as 别名]
# 或者: from hyperion.model.Model import read [as 别名]
import numpy as np
from hyperion.model import Model
from hyperion.dust import SphericalDust
from hyperion.util.constants import pc

for tau_v in [0.1, 1.0, 20.0]:

    m = Model.read('bm1_slab_eff_tau{0:05.2f}_temperature.rtout'.format(tau_v), only_initial=False)

    m.set_n_initial_iterations(0)

    del m.n_photons['initial']
    del m.n_photons['last']

    i = m.add_peeled_images()
    i.set_viewing_angles([0., 30., 60., 90., 120., 150., 180.], [0., 0., 0., 0., 0., 0., 0.])
    i.set_image_limits(-7.5 * pc, 7.5 * pc, -7.5 * pc, 7.5 * pc)
    i.set_image_size(300, 300)

    # Set up monochromatic mode
    m.set_monochromatic(True, wavelengths=[0.165, 0.570, 21.3, 161.6])

    # Use raytracing
    m.set_raytracing(True)

    # Set up number of photons
    m.set_n_photons(imaging_sources=1e9, imaging_dust=1e9,
                    raytracing_sources=1, raytracing_dust=1e9)

    # Write out and run
    m.write('bm1_slab_effgrain_tau_{0:05.2f}_images.rtin'.format(tau_v), overwrite=True)
开发者ID:rolfkuiper,项目名称:hyperion-trust,代码行数:33,代码来源:setup_images.py

示例4:

# 需要导入模块: from hyperion.model import Model [as 别名]
# 或者: from hyperion.model.Model import read [as 别名]
import numpy as np
from hyperion.model import Model
from hyperion.dust import SphericalDust
from hyperion.util.constants import au

m = Model.read('bm2_eff_vor_temperature.rtout', only_initial=False)

m.set_n_initial_iterations(0)

del m.n_photons['initial']
del m.n_photons['last']

i = m.add_peeled_images()
i.set_viewing_angles([0., 90., 90., 90., 90., 180.], [0., 0., 90., 180., 270., 0.])
i.set_image_limits(-60 * au, 60 * au, -60 * au, 60 * au)
i.set_image_size(300, 300)

# Set up monochromatic mode
m.set_monochromatic(True, wavelengths=[0.10019, 0.55165, 2.00293, 10.03850, 101.15800])

# Use raytracing
m.set_raytracing(True)

# Set up number of photons
m.set_n_photons(imaging_sources=1e7, imaging_dust=1e7,
                raytracing_sources=1, raytracing_dust=1e7)

# Write out and run
m.write('bm2_eff_images.rtin', overwrite=True)
m.run('bm2_eff_images.rtout', mpi=True)
开发者ID:hyperion-rt,项目名称:hyperion-trust,代码行数:32,代码来源:setup_images.py


注:本文中的hyperion.model.Model.read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。