Hi Tomer,

Its possible its a problem with particle data then.  Matt Turk or Chris Moody - ideas?

I don't think I've ever gotten surface generation to work with particle data, but admittedly, I didn't try very hard :P

Cheers,
-Jill

On Sun, Oct 18, 2015 at 4:44 PM, Tomer Nussbaum <tomer.nussbaum@mail.huji.ac.il> wrote:
Hey Jill,

I've checked, and export_obj() does not work. :(
All of this function collapse in "get_vertex_centered_data"...

I would really appreciate if someone could answer me on the questions I've sent, since I try to write some code to solve this issue.


Thanx,
Tomer


Following is the code and errors (python 2.7, YT3.2):
sp = ds.sphere(center=center, radius=(2,'kpc'))
rho = 5e-27
#surf = ds.surface(sp, ('gas', 'density'), rho)
surf = ds.surface(sp, ("deposit", "all_density"), rho)
surf.export_obj("sph_2.kpc",
                color_field = "temperature")

yt : [INFO     ] 2015-10-18 17:27:05,014 Extracting (sampling: temperature)
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-8-9ab0ccc2f049> in <module>()
      1 surf.export_obj("sph_2.kpc",
----> 2                 color_field = "temperature")

/home/sharonl/miniconda/envs/iyt32/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.pyc in export_obj(self, filename, transparency, dist_fac, color_field, emit_field, color_map, color_log, emit_log, plot_index, color_field_max, color_field_min, emit_field_max, emit_field_min)
   1233         if self.vertices is None:
   1234             if color_field is not None:
-> 1235                 self.get_data(color_field,"face")
   1236         elif color_field is not None:
   1237             if color_field not in self.field_data:

/home/sharonl/miniconda/envs/iyt32/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.pyc in get_data(self, fields, sample_type, no_ghost)
   1032                 my_verts = self._extract_isocontours_from_grid(
   1033                                 block, self.surface_field, self.field_value,
-> 1034                                 mask, fields, sample_type, no_ghost=no_ghost)
   1035                 if fields is not None:
   1036                     my_verts, svals = my_verts

/home/sharonl/miniconda/envs/iyt32/lib/python2.7/site-packages/yt/data_objects/construction_data_containers.pyc in _extract_isocontours_from_grid(self, grid, field, value, mask, sample_values, sample_type, no_ghost)
   1053                                        sample_type = "face",
   1054                                        no_ghost = False):
-> 1055         vals = grid.get_vertex_centered_data(field, no_ghost = no_ghost)
   1056         if sample_values is not None:
   1057             svals = grid.get_vertex_centered_data(sample_values)

/home/sharonl/miniconda/envs/iyt32/lib/python2.7/site-packages/yt/data_objects/octree_subset.pyc in get_vertex_centered_data(self, *args, **kwargs)
    443 
    444     def get_vertex_centered_data(self, *args, **kwargs):
--> 445         raise NotImplementedError
    446 
    447     @property

NotImplementedError: 


Date: Thu, 15 Oct 2015 08:58:50 -0400
From: "Naiman, Jill" <jill.naiman@cfa.harvard.edu>
To: Discussion of the yt analysis package
        <yt-users@lists.spacepope.org>
Subject: Re: [yt-users] surf.export_ply issues
Message-ID:
        <CAFwWoV9HeT2UE33LFJHwW7sto0zV6RiX5VojYGFb0PCsLizccg@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi Tomer,

One thing you might try is the export_obj function instead of the
export_ply since its been updated more recently.  I think it *should* work
on particle data these days (though, someone should correct me if I'm
wrong).

If that doesn't work, please let the list know though.

Cheers,
-Jill

On Thu, Oct 15, 2015 at 4:26 AM, Tomer Nussbaum <
tomer.nussbaum@mail.huji.ac.il> wrote:

> Hello there,
>
>
> I want to make a 3D model of my ART simulation with the YT platform. After
> much reading and talking in the YT mirc I understand some code is needed to
> make it work.
>
> I would appreciate if you could answer me about some questions I have had
> through the last couple of days:
>
> 0. I understand that "export_ply" and the other functions in YTSurfaceBase
> work on other simulation but not on "particle based simulations" like ART.
> is this correct?
> 1. Why does it not work on ART sim?
> 2. What should I do in order to make it run on ART sim?
> 3. What does "get_vertex_centered_data" suppose to do? most of the time
> the error come from this function (not implemented..), is it a the main
> problem? can I work around it?
> 4. Is there a way to transform the ART data to some data that do work in
> order to make it work?
> 5. What is "particle based simulations"?
>
>
>
> Thnx,
> Tomer
>


_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org