[yt-users] new fields in output

David Collins dcollins at physics.ucsd.edu
Sun Jul 17 05:54:05 PDT 2011


> Since pf.field_info["PotentialField"].get_units() doesn't give me anything, is it safe to assume they are in code units? (i.e. [code velocity]^2)?

I think that's a reasonable assumption, but I would check by printing
out a few values (pf.h.grids[0]['PotentialField][0,0,0]) and comparing
what's in the hdf5 file with h5dump.

I would also force the units to be what you want in the plugins file.
Defiine "pluginfilename = yt_location" in ~/.yt.config, then in that
file put

def PotentialConvert(data):
 return data.convert('x-velocity')**2
add_field("Potential",convert_function=PotentialConvert)

d.

On Sat, Jul 16, 2011 at 2:57 AM, Elizabeth Tasker <taskere at mcmaster.ca> wrote:
> Hi,
>
> This is a bit of a thread resurrection....
>
> As Matt says below, yt correctly finds the fields in an Enzo simulation, even when there is an unexpected extra one such as PotentialField, but I do want to check the units.
>
>
> Thank you~
>
> Elizabeth
>
>
> On 2011-03-11, at 4:40 AM, Matthew Turk wrote:
>
>> Hi Elizabeth,
>>
>> On Thu, Mar 10, 2011 at 11:36 AM, Elizabeth Tasker <taskere at mcmaster.ca> wrote:
>>> Hi,
>>>
>>> I've added PotentialField to the data that gets outputted. I'd like to read
>>> this into yt, but how does this work when yt won't be expecting
>>> PotentialField to be one of the data sets?
>>>
>>> Elizabeth
>>
>> yt actually does a field detection step, where it randomly samples 20
>> grids, checks their fields, and performs a union on the set of field
>> names.  If PotentialField is output in every single grid, it will
>> definitely find it, and it should appear in the .field_list property
>> of the hierarchy.  Can you give it a shot?  Once that's done, there
>> might be a bit of handling for it to get the units correct.  (I
>> actually, coincidentally, just two days ago used the
>> OutputPotentialField capability in enzo 2.0 and found that it worked
>> just fine for me, so hopefully your results will be the same.)
>>
>> -Matt
>>
>>> _______________________________________________
>>> 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
>



-- 
Sent from my computer.



More information about the yt-users mailing list