[yt-users] field parameters (you know I want to use them everywhere...)
Elizabeth Tasker
tasker at astro1.sci.hokudai.ac.jp
Wed Nov 30 06:48:44 PST 2011
Hi Matt,
Calling it with dd is fine, it's when creating a slice I hit problems, i.e.
pc.add_slice("EffectivePotential", 2, field_parameters={"disk_vector":disk_vector,
"disk_center":disk_center, "thiscore_omega":core_omega[c]})
And.... this is the script that decides to save my images in a confusing place:
http://paste.yt-project.org/show/1963/
It's a bit of an unhelpful beast, being long and using a non-default field of Enzo's (PotentialField). I can try making a smaller one that gives the same problem.
Elizabeth
On 2011-11-30, at 11:39 PM, Matthew Turk wrote:
> Hi Elizabeth,
>
> I can't reproduce your first error. I am using this script:
>
> http://paste.yt-project.org/show/1973/
>
> and I am using revision a519b8754ba8.
>
> For your second error, it's a mystery to me; it's grabbing the path to
> your plugins file for some reason. Can you maybe show a script that
> you use that produces this error?
>
> -Matt
>
> On Wed, Nov 30, 2011 at 3:31 AM, Elizabeth Tasker
> <tasker at astro1.sci.hokudai.ac.jp> wrote:
>> Hi,
>>
>> Two small problems:
>>
>> 1. Another issue with field parameters. I can't pass them to a slice
>> if the derived field also needs ValidateSpatial.
>>
>> i.e.
>>
>> def _EffectivePotential(field, data):
>>
>> center = na.array(data.get_field_parameter("disk_center"))
>> h_vec = na.array(data.get_field_parameter("disk_vector"))
>> omega = na.array(data.get_field_parameter("thiscore_omega"))
>> .
>> .
>> blah
>> .
>> .
>> add_field("EffectivePotential", function=_EffectivePotential,
>> validators=[ValidateSpatial(1, ["x-velocity", "y-velocity",
>> "z-velocity", "x", "y", "z"])])
>>
>>
>> p = pc.add_slice("EffectivePotential", 2,
>> field_parameters={"disk_vector":disk_vector,
>> "disk_center":disk_center, "thiscore_omega":core_omega[c]})
>>
>> can't find its field parameters but if I change the end line of the function to:
>>
>> add_field("EffectivePotential", function=_EffectivePotential)
>>
>> everything is fine.
>>
>> It actually seems to work OK even without the ValidateSpatial (I have
>> cross products in the function so pain has the potential to happen
>> without the full data) so perhaps this isn't a problem, but I think it
>> is a small bug?
>>
>>
>> 2. For some reason, yt has decided to save all my image files in:
>>
>> /home/tasker/.yt/my_plugins.py_Slice_z_EffectivePotential.png
>>
>> This is less than intuitive. Does anyone know why and how I can stop it?
>>
>> Thanks!
>>
>> Elizabeth
>> _______________________________________________
>> 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