[yt-users] Error in reading the hydrodynamics dataset in Ramses

Matthew Turk matthewturk at gmail.com
Mon Nov 25 04:33:38 PST 2013


Hi Sam,

On Mon, Nov 25, 2013 at 6:18 AM, Sam Geen <samgeen at astro.ox.ac.uk> wrote:
> Hi,
>
> I ran into this problem as well; turns out I was running a simulation with
> 11 variables and not 8 as the Makefile said (apparently the MHD module
> silently adds 3). A few things that might be worth looking at:
> 1) When I re-ran load() with a new field array in the same ipython instance,
> it kept the old one (i.e. "We are looking for 8 fields." even when I'd
> changed it to 11 elements) unless I restarted Python.

Ah, yes.  This is something that needs to be addressed -- because of
how pickling (currently) works we cache parameter files.  It leads to
side effects like this, and in general is not worth the hassle.

> 2) The 2nd Fortran record in the hydro files in RAMSES is a 4-byte integer
> containing NVAR; this could be a useful thing to read to check against the
> user's fields array to say, e.g. "You provided [len(fields)] fields, but
> this output contains [NVAR] fields".

!!  I didn't know this!  I was planning to add an aliasing feature for
field lists, but this is incredibly useful as well.  I'll update the
mailing list when the PR is issued.

> 3) It could also be nice if an output would work anyway if the user provides
> fewer fields than are in the file, since it's possible to, say, read the
> density without reading the metallicity (a lot of RAMSES simulations have
> different versions depending on what patches you're using, but all RAMSES
> outputs will have [density, [x/y/z]-velocity*, pressure]. It depends how YT
> reads RAMSES hydro files, but it shouldn't be necessary to a priori know the
> number of fields as long as you don't try to read more than NVAR.

I agree.  I will implement this, too.

Thanks for all the tips and suggestions!

-Matt

>
> Cheers,
>
> Sam
>
> *Depending on the number of dimensions, which is the record after NVAR.
>
>
> On 20/11/13 23:56, Junhwan Choi (최준환) wrote:
>>
>> Thank you, now it works.
>> Junhwan
>>
>> On Wed, Nov 20, 2013 at 4:33 PM, Romain Teyssier
>> <romain.teyssier at gmail.com> wrote:
>>>
>>> In the Makefile you should have NVAR=6.
>>>
>>> Romain
>>>
>>>> Le 20 nov. 2013 à 23:15, Junhwan Choi (최준환) <choi.junhwan at gmail.com> a
>>>> écrit :
>>>>
>>>> Hi Romain,
>>>>
>>>> Yes, it is Pierre's cudaton simulation.
>>>> If this is the case where do I find how many  variables the simulation
>>>> use and what he names are?
>>>> I can ask to pierre, if there is no such a information in the simulation
>>>> output.
>>>>
>>>> Thank you,
>>>> Junhwan
>>>>
>>>> On Wed, Nov 20, 2013 at 3:53 PM, Romain Teyssier
>>>> <romain.teyssier at gmail.com> wrote:
>>>>>
>>>>> Hi Junhwan,
>>>>>
>>>>> The name of your repository “rhd” suggests that you are using the
>>>>> radiation solver.
>>>>> In this case, you must have more than 5 variables, probably 6 or more.
>>>>> So you need to use :
>>>>> fields = ["Density","x-velocity",
>>>>> "y-velocity","z-velocity",”Pressure”,”var6”,”var7”,...]).
>>>>>
>>>>> Romain
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On 20 Nov 2013, at 22:50, Junhwan Choi (최준환) <choi.junhwan at gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>> Thank you, Kearn.
>>>>>>
>>>>>> I tried your suggestion that I used
>>>>>> ds =
>>>>>> load("/lustre/widow2/proj/ast031/test11_rhd_fesc=0.05/output_00048/info_00048.txt",
>>>>>> fields = ["Density","x-velocity", "y-velocity",
>>>>>> "z-velocity","Pressure"]).
>>>>>> But, it results in the identical error message.
>>>>>> I still do not know what I need to do.
>>>>>>
>>>>>> Regard,
>>>>>> Junhwan
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Wed, Nov 20, 2013 at 10:37 AM,  <k.grisdale at surrey.ac.uk> wrote:
>>>>>>> Hi Junhwan
>>>>>>>
>>>>>>> I think the problem you might the having is you need to specify the
>>>>>>> fields you read into yt. To do this just modify you load command to this:
>>>>>>>
>>>>>>> ds =
>>>>>>> load("/lustre/widow2/proj/ast031/test11_rhd_fesc=0.05/output_00048/info_00048.txt”,
>>>>>>> fields = ["Density","x-velocity", "y-velocity", "z-velocity", "Pressure”])
>>>>>>>
>>>>>>> (Assuming that you are running a 3d Simulation with NVAR set as 5)
>>>>>>>
>>>>>>> Hope that helps
>>>>>>>
>>>>>>> Kearn
>>>>>>>
>>>>>>>
>>>>>>>> On 20 Nov 2013, at 16:26, Junhwan Choi (최준환)
>>>>>>>> <choi.junhwan at gmail.com> wrote:
>>>>>>>>
>>>>>>>> Hi yt users,
>>>>>>>>
>>>>>>>> I try to make a basic visualization for the Ramses simulation using
>>>>>>>> following script:
>>>>>>>> ==========================
>>>>>>>> from yt.mods import *
>>>>>>>>
>>>>>>>> ds =
>>>>>>>> load("/lustre/widow2/proj/ast031/test11_rhd_fesc=0.05/output_00048/info_00048.txt")
>>>>>>>> center = [0.5, 0.5, 0.5]
>>>>>>>>
>>>>>>>> pw = ProjectionPlot(ds, "x", ("deposit", "all_density"))
>>>>>>>> pw.zoom(1.01)
>>>>>>>> pw.save("allview")
>>>>>>>>
>>>>>>>> pw = ProjectionPlot(ds, "x", "Density")
>>>>>>>> pw.zoom(1.01)
>>>>>>>> pw.save("allviewGas")
>>>>>>>> ============================
>>>>>>>> It WORKS for the particle projection (for allview) but it does not
>>>>>>>> work for gas projection.
>>>>>>>>
>>>>>>>> When the yt try to deal with gas dataset, I got the following error
>>>>>>>> message and the script crash.
>>>>>>>> You are running with the wrong number of fields.
>>>>>>>> Please specify these in the load command.
>>>>>>>> We are looking for 6 fields.
>>>>>>>> The last set of field sizes was: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
>>>>>>>> 2,
>>>>>>>> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
>>>>>>>> 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
>>>>>>>> Traceback (most recent call last):
>>>>>>>> File "DenVis_DM_Gas.py", line 10, in <module>
>>>>>>>>   pw = ProjectionPlot(ds, "x", ("gas", "Density"))
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/visualization/plot_window.py",
>>>>>>>> line 1441, in __init__
>>>>>>>>   field_parameters = field_parameters)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/construction_data_containers.py",
>>>>>>>> line 234, in __init__
>>>>>>>>   self.get_data(field)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/construction_data_containers.py",
>>>>>>>> line 278, in get_data
>>>>>>>>   chunk_fields, "io")):
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/utilities/parallel_tools/parallel_analysis_interface.py",
>>>>>>>> line 434, in parallel_objects
>>>>>>>>   for obj_id, obj in oiter:
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/data_containers.py",
>>>>>>>> line 453, in chunks
>>>>>>>>   self.get_data(fields)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/data_objects/data_containers.py",
>>>>>>>> line 531, in get_data
>>>>>>>>   fluids, self, self._current_chunk)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/geometry/geometry_handler.py",
>>>>>>>> line 520, in _read_fluid_fields
>>>>>>>>   chunk_size)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/frontends/ramses/io.py",
>>>>>>>> line 41, in _read_fluid_selection
>>>>>>>>   rv = subset.fill(content, fields, selector)
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/frontends/ramses/data_structures.py",
>>>>>>>> line 304, in fill
>>>>>>>>   for level, offset in enumerate(self.domain.hydro_offset):
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/frontends/ramses/data_structures.py",
>>>>>>>> line 102, in hydro_offset
>>>>>>>>   hvals = fpu.read_attrs(f, header, "=")
>>>>>>>> File
>>>>>>>> "/autofs/na3_home1/jhchoi/common/src/yt-hg/yt/utilities/fortran_utils.py",
>>>>>>>> line 74, in read_attrs
>>>>>>>>   assert(s1 == s2)
>>>>>>>> AssertionError
>>>>>>>>
>>>>>>>> I do not understand what is the problem since it is such a basic
>>>>>>>> visualization.
>>>>>>>> Since I am new for Ramses data, I may take a simple mistake.
>>>>>>>> Can anyone explain what the error message means and how to resolve
>>>>>>>> the problem?
>>>>>>>>
>>>>>>>> Thank you in advance,
>>>>>>>> Junhwan
>>>>>>>> _______________________________________________
>>>>>>>> yt-users mailing list
>>>>>>>> yt-users at lists.spacepope.org
>>>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> yt-users mailing list
>>>>>>> yt-users at lists.spacepope.org
>>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>>
>>>>>> _______________________________________________
>>>>>> yt-users mailing listf = FortranFile('filename')
>>>>>> yt-users at lists.spacepope.org
>>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>>
>>>>> _______________________________________________
>>>>> yt-users mailing list
>>>>> yt-users at lists.spacepope.org
>>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list