[yt-users] How to calculate a field THEN plot a slice, not have SlicePlot recalculate the field

Rajika Kuruwita rajikakuruwita at gmail.com
Sun Oct 16 21:19:48 PDT 2016


Hi yt-users,

I have created a field that calculates the enclosed mass in the simulation
domain from a centre. This isn't a conventional field which can be
calculated from one-to-one matrix multiplication like most fields, but
needs to be aware of all the cells interior to the cell being calculated
for.

The field returns the correct values when I retrieve it using:
dd = ds.all_data()
dd['Enclosed_Mass'],

But when creating a Slice plot it gives the wrong values.

I realise this is because when creating a plot with one of those functions,
yt calculates the field only for the cells used in the slice plot, hence
severely underestimates the actual enclosed mass because it is ignoring all
other cells.

I know this is to make yt much faster and works for most fields, but I'm
wondering if anyone else has encountered this issue, and figured out work
arounds?

Regards,
Rajika



-- 
Rajika Kuruwita
PhD Candidate at Australian National University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20161017/752546d0/attachment.htm>


More information about the yt-users mailing list