RozanskiT / vidmapy

vidmapy - python wrapper for Kurucz's ATLAS/SYNTHE codes
MIT License
5 stars 2 forks source link

Issues when running get_spectrum() from Synthe #3

Closed Nico-Godoy closed 7 months ago

Nico-Godoy commented 8 months ago

Hi. I'm getting the following error (see below) when I run the tutorial/examples (I copied the entire input/output, just in case). I installed vidmapy as explained in the readme file. I included in the code the modifications from the fork of "sdrewchojnowski". However, I get the same error with/without these modifications. Do you have any idea where the problem is and how to fix it? Many thank!!

from vidmapy.kurucz.atlas import Atlas from vidmapy.kurucz.synthe import Synthe from vidmapy.kurucz.parameters import Parameters import matplotlib.pyplot as plt

atlas_worker = Atlas() model = atlas_worker.get_model(Parameters(teff=8000., logg=4.0, metallicity=0.0, microturbulence=2.0 ))

synthe_worker = Synthe() spectrum = synthe_worker.get_spectrum(model, Parameters(wave_min=4500., wave_max=5000., vsini=50.)) INFO: While explicitly defining parameters for SYNTHE get_spectrum() method vsini, resolution, wave_min, wave_max microturbulence, chemical_composition and metallicity are taken from 'parameters' function input. forrtl: No such file or directory forrtl: severe (29): file not found, unit 17, file /tmp/synthe_jb9hu87a/fort.17 Image PC Routine Line Source
xnfpelsyn.exe 080B5300 Unknown Unknown Unknown xnfpelsyn.exe 080B4DF8 Unknown Unknown Unknown xnfpelsyn.exe 08088DCD Unknown Unknown Unknown xnfpelsyn.exe 08069A3C Unknown Unknown Unknown xnfpelsyn.exe 08069EDF Unknown Unknown Unknown xnfpelsyn.exe 0806E829 Unknown Unknown Unknown xnfpelsyn.exe 08048332 Unknown Unknown Unknown xnfpelsyn.exe 080482A8 Unknown Unknown Unknown xnfpelsyn.exe 080BB127 Unknown Unknown Unknown xnfpelsyn.exe 08048161 Unknown Unknown Unknown forrtl: No such file or directory forrtl: severe (29): file not found, unit 11, file /tmp/synthe_jb9hu87a/fort.11 Image PC Routine Line Source
rline2.exe 08098304 Unknown Unknown Unknown rline2.exe 08097DFC Unknown Unknown Unknown rline2.exe 0808E2A5 Unknown Unknown Unknown rline2.exe 08068408 Unknown Unknown Unknown rline2.exe 080688AB Unknown Unknown Unknown rline2.exe 0804DD01 Unknown Unknown Unknown rline2.exe 080485FF Unknown Unknown Unknown rline2.exe 080482A8 Unknown Unknown Unknown rline2.exe 0809E127 Unknown Unknown Unknown rline2.exe 08048161 Unknown Unknown Unknown forrtl: No such file or directory forrtl: severe (29): file not found, unit 10, file /tmp/synthe_jb9hu87a/fort.10 Image PC Routine Line Source
synthe.exe 080A3F1C Unknown Unknown Unknown synthe.exe 080A3A14 Unknown Unknown Unknown synthe.exe 0807871D Unknown Unknown Unknown synthe.exe 08053FD8 Unknown Unknown Unknown synthe.exe 0805447B Unknown Unknown Unknown synthe.exe 08058DC5 Unknown Unknown Unknown synthe.exe 0804866A Unknown Unknown Unknown synthe.exe 080482A8 Unknown Unknown Unknown synthe.exe 080A9D47 Unknown Unknown Unknown synthe.exe 08048161 Unknown Unknown Unknown forrtl: No such file or directory forrtl: severe (29): file not found, unit 2, file /tmp/synthe_jb9hu87a/fort.2 Image PC Routine Line Source
spectrv.exe 080B6A3C Unknown Unknown Unknown spectrv.exe 080B6534 Unknown Unknown Unknown spectrv.exe 0808A509 Unknown Unknown Unknown spectrv.exe 0806B178 Unknown Unknown Unknown spectrv.exe 0806B61B Unknown Unknown Unknown spectrv.exe 0806FF65 Unknown Unknown Unknown spectrv.exe 080585FF Unknown Unknown Unknown spectrv.exe 08053039 Unknown Unknown Unknown spectrv.exe 080485B6 Unknown Unknown Unknown spectrv.exe 080482A8 Unknown Unknown Unknown spectrv.exe 080BC867 Unknown Unknown Unknown spectrv.exe 08048161 Unknown Unknown Unknown Traceback (most recent call last): File "", line 1, in File "/home/nick/Programs/anaconda3/envs/my-space/lib/python3.9/site-packages/vidmapy/kurucz/synthe.py", line 40, in get_spectrum spectrum = self._create_temp_direcotry_and_run_SYNTHE(self.model,self.linelist) File "/home/nick/Programs/anaconda3/envs/my-space/lib/python3.9/site-packages/vidmapy/kurucz/synthe.py", line 52, in _create_temp_direcotry_and_run_SYNTHE spectrum = self._compute_spectrum(tmpdirname, model, linelist) File "/home/nick/Programs/anaconda3/envs/my-space/lib/python3.9/site-packages/vidmapy/kurucz/synthe.py", line 61, in _compute_spectrum self._run_spectrv(tmpdirname, model) File "/home/nick/Programs/anaconda3/envs/my-space/lib/python3.9/site-packages/vidmapy/kurucz/synthe.py", line 117, in _run_spectrv os.rename(os.path.join(tmpdirname,"fort.7"), os.path.join(tmpdirname,"spec.bin")) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/synthe_jb9hu87a/fort.7' -> '/tmp/synthe_jb9hu87a/spec.bin'

RozanskiT commented 7 months ago

Hi Nico,

Apologies for the delayed response. I have a couple of questions to help troubleshoot the issue. First, which operating system are you using? The software has only been tested on Ubuntu and may not work with macOS or Windows. Second, could you verify if the atomic data has been placed exactly as mentioned in the readme? The directory structure should be precisely as follows:

> pwd
.../vidmapy/vidmapy/kurucz/atomic_data
> ls
ODF lines molecules

Please let me know if these were helpful.

Update: I've just realized that this error occurs when calling Synthe, whereas Atlas seems to work just fine. You might also want to verify that the variable model actually contains the model, for example, by plotting it as demonstrated here:

f, ax = plt.subplots(1, 1)
ax.plot(model.structure["RHOX"], model.structure["T"])
ax.set_title('Atmosphere model')
ax.set_xlabel("RHOX")
ax.set_ylabel("T [K]")

plt.show()
Nico-Godoy commented 7 months ago

Dear Tomasz, Thank you for your reply. I am using Linux Mint, so in principle, there is no problem running the code. I downloaded the folder ( atom_data_kurucz.tar.xz ) from the website specified in the readme, and then I just unpacked (removing the _kurucz in the name). And the name is different indeed! 'atom_data' should be 'atomic_data'. When I changed the name, the code ran without any error. Thank you so much for your help! I appreciate it so much! Best wishes, Nico

RozanskiT commented 7 months ago

Hi Nico!

I'm happy that this was helpful! All the best, Tomasz