phantom
phantom copied to clipboard
Issue regarding reading the simulation output files using python readers
Hello, I am new to Phantom. I have managed to successfully run the simulation. The output files I got after running the simulation are the standard output files.
I need to read the output files using the python codes. I followed the instructions on the bitbucket documentation for Analysis with Python. I followed these steps for that: make pyanalysis After this step I am getting the files libphantom.so and libanalysis.py
However then when I am opening a python script and using the below command:
from libanalysis import PhantomAnalysis as pa
I am getting the following error:
Traceback (most recent call last):
File "
Could I please get some help on this?
Cheers Auratrik
I guess your simulation is isothermal but it is trying to read the thermal energy for some reason, which does not exist
Hi So, I checked my simulation again. It is isothermal. But also I went to the source code where the error is occuring. The file is located in phantom-master/scripts/pyphantom and is named phantomanalysis.py
Here the code snippet causing the problem is: try: self.utherm = self.get_part_u(npart)/(udist2/utime2) except: print "Unable to load uterm, likely the quantity is not stored." try: self.temperature = self.get_part_temp(npart) except: print "Unable to load temperature, likely the quantity is not stored." try: self.bxyz = self.get_part_bxyz(npart)/umagfd except: print "Unable to load magnetic field, likely the quantity is not stored."
For checking purposes I temporarily removed the thermal energy part from the code to check the temperature and magnetic field code. But for both temperature and magnetic field the same problem is coming, ie, it is telling that the quantity is not stored. However, in the simulation I used mhd so both temperature and magnetic field data should be there.
Is there some way to fix this problem ? Cheers Auratrik
These issues are solved by https://github.com/ttricco/sarracen