[yt-users] Blocky Projections with RAMSES data when log=True
Matthew Turk
matthewturk at gmail.com
Fri Oct 4 07:14:12 PDT 2013
Hi Mike,
Ah! This is a fun one, and there are two possible causes for it.
(Thanks for the bug report, by the way.)
* The field count on disk is not the same as what yt thinks it should
expect. (I don't think there's a way to detect the number or names of
fields in a RAMSES file, but if there is ....) This can be fixed by
supplying the argument fields to the load() command. The default
field list is ["Density", "x-velocity", "y-velocity", "z-velocity",
"Pressure", "Metallicity"]. So if you have any additional, or fewer
than that, fields, you can specify them and it should work.
* The other possibility is that your simulation has boundary
conditions that live outside the domain. This was fixed very
recently: https://bitbucket.org/yt_analysis/yt-3.0/pull-request/107/adding-a-count-boundary-option-to
and is typically seen when the boundary is specified. If you are
running 3.0, you can update with:
(the directory may be different -- it may just be yt-hg -- but you can
see what it is from "yt instinfo")
cd $YT_DEST/src/yt-hg-3.0/
hg pull -r tip https://bitbucket.org/yt_analysis/yt-3.0
hg up
python2.7 setup.py build_ext -i -f
Can you try again, and let us know? Just doing "pf.h" should show the
error, and if that succeeds, it should work.
Sorry for the trouble!
-Matt
On Fri, Oct 4, 2013 at 10:09 AM, Butler,Michael J
<butler85 at astro.ufl.edu> wrote:
> Hi Matt,
>
> Thanks. The problem is (which was going to be my next email, and the reason
> I was trying out 2.5), I can't seem to make plots in the 3.0 branch anymore
> since updating it. I don't recall which version it was when I could, but
> now I get the error at the end of the email when I try and make a
> slice/projection (it happens both with the PlotCollection method as well as
> SlicePlot).
>
> -Mike
>
>
>
> In [5]: pc.add_slice("Density",2)
> ---------------------------------------------------------------------------
> AssertionError Traceback (most recent call last)
> /home/itp/butler/yt-x86_64/src/yt-hg/scripts/iyt in <module>()
> ----> 1 pc.add_slice("Density",2)
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py in
> add_slice(self, field, axis, coord, center, use_colorbar, figure, axes,
> fig_size, periodic, obj, field_parameters)
> 427 if obj is None:
> 428 if field_parameters is None: field_parameters = {}
> --> 429 obj = self.pf.hierarchy.slice(axis, coord, field,
> 430 center=center, **field_parameters)
> 431 p = self._add_plot(PCSlicePlot(
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/data_objects/static_output.py in
> hierarchy(self)
> 223 raise RuntimeError("You should not instantiate
> StaticOutput.")
> 224 self._instantiated_hierarchy = self._hierarchy_class(
> --> 225 self, data_style=self.data_style)
> 226 return self._instantiated_hierarchy
> 227 h = hierarchy # alias
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/frontends/ramses/data_structures.py
> in __init__(self, pf, data_style)
> 301
> 302 self.float_type = np.float64
> --> 303 super(RAMSESGeometryHandler, self).__init__(pf, data_style)
> 304
> 305 def _initialize_oct_handler(self):
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/geometry/geometry_handler.py in
> __init__(self, pf, data_style)
> 66
> 67 mylog.debug("Setting up domain geometry.")
> ---> 68 self._setup_geometry()
> 69
> 70 mylog.debug("Initializing data grid data IO")
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/geometry/oct_geometry_handler.py in
> _setup_geometry(self)
> 48 def _setup_geometry(self):
> 49 mylog.debug("Initializing Octree Geometry Handler.")
> ---> 50 self._initialize_oct_handler()
> 51
> 52 def get_smallest_dx(self):
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/frontends/ramses/data_structures.py
> in _initialize_oct_handler(self)
> 306 nv = len(self.fluid_field_list)
> 307 self.domains = [RAMSESDomainFile(self.parameter_file, i + 1,
> nv)
> --> 308 for i in range(self.parameter_file['ncpu'])]
> 309 total_octs = sum(dom.local_oct_count #+ dom.ngridbound.sum()
> 310 for dom in self.domains)
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/frontends/ramses/data_structures.py
> in __init__(self, pf, domain_id, nvar)
> 70 self._read_amr_header()
> 71 self._read_particle_header()
> ---> 72 self._read_amr()
> 73
> 74 _hydro_offset = None
>
> /home/itp/butler/yt-x86_64/src/yt-hg/yt/frontends/ramses/data_structures.py
> in _read_amr(self)
> 248 assert(pos.shape[0] == ng)
> 249 n = self.oct_handler.add(cpu + 1, level -
> min_level, pos)
> --> 250 assert(n == ng)
> 251 self.oct_handler.finalize()
> 252
>
> AssertionError:
>
>
>
>
> On Fri, 4 Oct 2013 09:11:36 -0400, Matthew Turk wrote:
>
> Hi Mike,
>
> The stable branch of yt probably doesn't work with RAMSES anymore... I think
> we even disabled it recently.
>
> However, the 3.0 branch (listed as "bleeding edge" on the website) full
> supports Ramses and is considerably faster and more memory conservative. I'd
> suggest you give it a shot - at this point it's quite stable and production
> ready. The docs are still lagging but that's next up; for Ramses it should
> be mostly identical in usage. If you do run into any trouble, drop a line
> here?
>
> Matt
>
> On Oct 4, 2013 9:04 AM, "Butler,Michael J" <butler85 at astro.ufl.edu> wrote:
>>
>> Hi everyone,
>>
>> I have been working with the stable branch of yt to look at RAMSES data
>> and have run into a problem. When doing simple projections of e.g. Density
>> with take_log=True, the projection becomes blocky (see attached image).
>> This doesn't happen if I take out the take_log line. Here is what I am
>> doing :
>>
>> pf = load("output_00427/info_00427.txt")
>> pf.h
>> pf.field_info['Density'].take_log = True
>> p=SlicePlot(pf,2,"Density")
>>
>> Any ideas what is going on here?
>>
>> Thanks,
>>
>> Mike
>> _______________________________________________
>> 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