hyperion-rt / hyperion

Hyperion Radiative Transfer Code
http://www.hyperion-rt.org
BSD 2-Clause "Simplified" License
52 stars 26 forks source link

Run did not complete successfully: output file appears to be corrupt /bin/sh: 1: hyperion_car: not found #224

Open jdrevon opened 2 years ago

jdrevon commented 2 years ago

Hello,

I've installed Hyperion through pip instead of the Anaconda recommanded installation for conda users since I had some trouble with it.

Now things getting better, I had to modify in each files the location of "six" a depancy wich does no longer exist in astropy. I have seen in issues regadring to this and it marked solved but It seems that the version of 0.9.10 still contains commands calling six from astropy.

Anyway, I replaced this and only copy and paste some lines from the hyperion webpage tutorials.

I just wanted to give a try by running the code using the commands:

m.write('model.rtin')
m.run('model.rtout',overwrite=True)

However an error raised without any further explanation:

Run did not complete successfully: output file appears to be corrupt
/bin/sh: 1: hyperion_car: not found
An exception has occurred, use %tb to see the full traceback.

SystemExit: An error occurred, and the run did not complete

runfile('/home/jdrevon/Bureau/Hyperion/test.py', wdir='/home/jdrevon/Bureau/Hyperion')
WARNING: Planck function for highest temperature not completely covered by opacity function [hyperion.dust.mean_opacities]
INFO: Computing emissivities assuming LTE [hyperion.dust.dust_type]
WARNING: Planck function for highest temperature not completely covered by opacity function [hyperion.dust.emissivities]
Traceback (most recent call last):

  File "/home/jdrevon/Bureau/Hyperion/test.py", line 101, in <module>
    m.write('model.rtin')

  File "/home/jdrevon/anaconda3/lib/python3.8/site-packages/hyperion/model/model.py", line 586, in write
    raise Exception("can't use binned images with forced first interaction - use set_forced_first_interaction(False) to disable")

Exception: can't use binned images with forced first interaction - use set_forced_first_interaction(False) to disable

It says that hyperion_car: not found. I've put hyperion on my prompt outside python and it recognized the command so it seems to be well installed. I've also dowloaded all the fortran dependancies. Here is my whole code maybe I completly missed something :/

# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""

from hyperion.model import Model, ModelOutput
from hyperion.dust import SphericalDust, IsotropicDust

import numpy as np

# Preparing dust properties

d= SphericalDust()

dust_wav = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.wav')

dust_chi = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.chi')

dust_alb = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.alb')

dust_f11 = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.f11')
dust_f12 = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.f12')
dust_f33 = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.f33')
dust_f34 = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.f34')

dust_g   = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.g')

dust_mu  = np.loadtxt('dust_prop/d03_3.1_6.0_A/d03_3.1_6.0_A.mu')

d.optical_properties.nu = 1/(dust_wav*1E-6)[::-1]
d.optical_properties.albedo = dust_alb[::-1]
d.optical_properties.chi = dust_chi[::-1]
d.optical_properties.mu = dust_mu[::-1]
d.optical_properties.P1 = dust_f11[::-1]
d.optical_properties.P2 = dust_f12[::-1]
d.optical_properties.P3 = dust_f33[::-1]
d.optical_properties.P4 = dust_f34[::-1]

d.set_sublimation_temperature('fast', temperature=1300.)

d.plot('mydust.png')
d.write('mydust.hdf5')

# Coordinate grids and physical quantities

m = Model()
x = np.linspace(-0.01,+0.01,11)
y = np.linspace(-0.01,+0.01,11)
z = np.linspace(-0.01,+0.01,11)
m.set_cartesian_grid(x,y,z)

m.add_density_grid(np.ones((10,10,10)),'mydust.hdf5')

# Luminosity Sources

lsol = 3.839E33
source = m.add_point_source()
source.luminosity = 8000*lsol
source.temperature = 2800
source.position= (0., 0., 0.)

# Setting up images and SEDs

image = m.add_binned_images()
image.set_wavelength_range(1000, 2.8, 13)
image.set_image_size(256, 256)
image.set_image_limits(-4E13, 4E13, -4E13, 4E13)

image.set_viewing_bins(10, 10)

image.set_output_bytes(4)
image.set_track_origin('detailed')
image.set_track_origin('scatterings', n_scat=5)

# Number of photons

m.set_raytracing(True)
m.set_n_photons(initial=1000000, imaging=1000000, raytracing_sources=1000000, raytracing_dust=1000000)
m.set_convergence(True, percentile=99., absolute=2., relative=1.02)

m.set_mrw(True, gamma=1.0)
m.set_pda(True)

# Density
m.conf.output.output_density = 'last'

# Density difference (shows where dust was destroyed)
m.conf.output.output_density_diff = 'none'

# Energy absorbed (using pathlengths)
m.conf.output.output_specific_energy = 'last'

# Number of unique photons that passed through the cell
m.conf.output.output_n_photons = 'last'

m.set_forced_first_interaction(False)

m.write('model.rtin')
m.run('model.rtout',overwrite=True)

# # Extracting SEDs and Images

# m = ModelOutput('simple_model.rtout')
# sed = m.get_sed(uncertainties=True)
# image = m.get_image()

Thank you in advance for your help

Regards

Julien

astrofrog commented 2 years ago

Sorry for my delay in replying - what happens if you type hyperion_car on the command-line? (this is one of the Fortran dependencies, so if it says 'command not found' it indicates there was an issue with the installation of the fortran dependencies)