Hi Matthew, I'm using a typical Enzo dataset so the field should be continuous. Thanks, Sam ________________________________ From: Matthew Turk <matthewturk@gmail.com> Sent: 15 September 2021 16:02 To: Discussion of the yt analysis package <yt-users@python.org> Subject: [yt-users] Re: Error when attempting to call surface object This email was sent to you by someone outside the University. You should only click on links or attachments if you are certain that the email is genuine and the content is safe. Hi Sam, This might be because the surface object works for datasets defined by continuous fields, rather than discretely sampled (i.e., grid vs particle/SPH). What type of dataset are you using? We might be able to work around it, though, by sampling to a regular mesh and then "surface"-ing... On Tue, Sep 14, 2021 at 5:51 AM Sam Patrick <sam.patrick@ed.ac.uk> wrote:
Hi all,
I've been trying to do some preliminary experimentation with YT's surface object. I have the following snippet of code:
sphere = ds.sphere(center, radius) surf = ds.surface(sphere, ('gas', 'density'), 1e-23) ratio = (surf.volume() / surf.surface_area).in_units('pc')
However when trying to run the code I get the following error:
File "my_analysis.py", line 107, in contours ratio = (surf.volume() / surf.surface_area).in_units('pc') File "/home/brs/stack/yt/yt/data_objects/selection_objects/data_selection_objects.py", line 1394, in volume return self.quantities.total_quantity(("index", "cell_volume")) File "/home/brs/stack/yt/yt/data_objects/derived_quantities.py", line 172, in __call__ rv = super().__call__(fields) File "/home/brs/stack/yt/yt/data_objects/derived_quantities.py", line 55, in __call__ for sto, ds in parallel_objects(chunks, -1, storage=storage): File "/home/brs/stack/yt/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 527, in parallel_objects for result_id, obj in oiter: File "/home/brs/stack/yt/yt/data_objects/selection_objects/data_selection_objects.py", line 94, in chunks for ci, chunk in enumerate(self.index._chunk(self, chunking_style, **kwargs)): File "/home/brs/stack/yt/yt/geometry/geometry_handler.py", line 233, in _chunk self._identify_base_chunk(dobj) File "/home/brs/stack/yt/yt/geometry/grid_geometry_handler.py", line 335, in _identify_base_chunk gi = dobj.selector.select_grids( File "/home/brs/stack/yt/yt/data_objects/selection_objects/data_selection_objects.py", line 73, in selector raise YTDataSelectorNotImplemented(self._type_name) P019 yt : [ERROR ] 2021-09-13 12:14:32,552 YTDataSelectorNotImplemented: Data selector 'surface' not implemented.
I was hoping someone could help with this. My yt version is 4.1.dev0 and my Python version is 3.8.5 Many thanks, Sam Patrick _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org https://mail.python.org/mailman3/lists/yt-users.python.org/ Member address: matthewturk@gmail.com
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org https://mail.python.org/mailman3/lists/yt-users.python.org/ Member address: sam.patrick@ed.ac.uk The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. Is e buidheann carthannais a th' ann an Oilthigh Dh?n ?ideann, cl?raichte an Alba, ?ireamh cl?raidh SC005336.