[yt-users] Command line rendering error

Nathan Goldbaum nathan12343 at gmail.com
Wed Jul 3 11:38:00 PDT 2013


Hi Noel,

I don't have time to fix this at the moment, but it should be a quick fix.
 Take a look at $YT_HG/yt/utilities/command_line.py.  That file contains
all of the logic for the command line subcommands.  You'll probably need to
modify the argparse argument parsing code for the render command to
properly capture the field argument.

If you have success with that, please don't hesitate to issue a pull
request for the change.  Take a look at the yt developer's guide (
http://yt-project.org/docs/2.5/advanced/developing.html#contributing-code) for
more detail on issuing pull requests.

-Nathan


On Wed, Jul 3, 2013 at 11:33 AM, Noel Scudder
<noel.scudder at stonybrook.edu>wrote:

> Hi yt users,
>
> I'm having a problem volume rendering through the command line. I've been
> playing around with the yt command, and I noticed that when I do
>
> $ yt plot --field density plt_def_00020
>
> I will get plots for my axes just as I would expect. However, if I do
>
> $ yt render --field density plt_def_00020
>
> I get the following error:
>
> Traceback (most recent call last):
>   File "/home/noel/shocks/yt-x86_64/bin/yt", line 9, in <module>
>     load_entry_point('yt==2.5.4', 'console_scripts', 'yt')()
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 1691, in run_main
>     args.func(args)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 97, in run
>     self(args)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 1404, in __call__
>     cam = pf.h.camera(center, L, width, (N,N), transfer_function=tf)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",
> line 225, in __init__
>     self.log_fields = [self.pf.field_info[f].take_log for f in self.fields]
>    File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 131, in __missing__
>     return self.fallback[key]
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 131, in __missing__
>     return self.fallback[key]
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 130, in __missing__
>     raise KeyError("No field named %s" % key)
> KeyError: 'No field named Density'
>
> It looks to me like the Camera function isn't being called with a specific
> field, and is defaulting to "Density", which is not a field for Castro
> data. I took a stab at fixing this by editing the camera line to
>
>    cam = pf.h.camera(center, L, width, (N,N), transfer_function=tf,
> fields=field)
>
> But then my command yields the following error:
>
> Traceback (most recent call last):
>   File "/home/noel/shocks/yt-x86_64/bin/yt", line 9, in <module>
>     load_entry_point('yt==2.5.4', 'console_scripts', 'yt')()
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 1691, in run_main
>     args.func(args)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 97, in run
>     self(args)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/utilities/command_line.py", line
> 1404, in __call__
>     cam = pf.h.camera(center, L, width, (N,N), transfer_function=tf,
> fields=field)
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",
> line 225, in __init__
>     self.log_fields = [self.pf.field_info[f].take_log for f in self.fields]
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 131, in __missing__
>     return self.fallback[key]
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 131, in __missing__
>     return self.fallback[key]
>   File
> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",
> line 130, in __missing__
>     raise KeyError("No field named %s" % key)
> KeyError: 'No field named d'
>
> I tried to delve a little deeper, but couldn't make any more headway. Does
> anyone know how to fix these errors? Thanks in advance.
>
> Cheers,
>
> Noel Scudder
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130703/39a84a39/attachment.html>


More information about the yt-users mailing list