Hi Nathan,

  thanks! I won't be able to look at this in earnest until later next week, so if you think you can look at it in the meantime, then great. I have filed an issue. Sorry I wasn't able to get back to this last week.

Cheers,
  -Mark

On 12 February 2018 at 19:38, <yt-dev-request@python.org> wrote:
Send yt-dev mailing list submissions to
        yt-dev@python.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://mail.python.org/mm3/mailman3/lists/yt-dev.python.org/
or, via email, send a message with subject or body 'help' to
        yt-dev-request@python.org

You can reach the person managing the list at
        yt-dev-owner@python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of yt-dev digest..."

Today's Topics:

   1. OctTree cut_region OffAxis Projections (Mark Richardson)
   2. Re: OctTree cut_region OffAxis Projections (Nathan Goldbaum)


----------------------------------------------------------------------

Date: Mon, 12 Feb 2018 17:49:21 -0500
From: Mark Richardson <mark.richardson.work@gmail.com>
Subject: [yt-dev] OctTree cut_region OffAxis Projections
To: yt-dev@python.org
Message-ID:
        <CA+qw_EzS2jGka-B+jqg0MJBqH5em2SAwi3GNuyb1J_xGtkgP1Q@mail.gmail.com>
Content-Type: multipart/alternative;
        boundary="001a1148215464247f05650bb037"

--001a1148215464247f05650bb037
Content-Type: text/plain; charset="UTF-8"

Hey, I've previously been able to make off-axis projections of ramses
datasets with geometric data containers. However, I've recently tried to do
this with a cut_region for dens gas, without success. Here is a script that
should work with a ramses cosmo dataset:

import yt
import numpy as np

num = 1
Look = [1.,1.,0]
Up = [0.,1.,1.]


c = np.array([0.5,0.5,0.5])
rad = 0.2
width = 2*rad
extra = 1.05
left  = c - rad*extra
right = c + rad*extra
bb = [left,right]

fn = "../output_{0:05d}/info_{0:05d}.txt"
ds = yt.load(fn.format(num),bbox=bb)

region = ds.region(c,left,right)

d20 = region.cut_region(['obj["density"] > 1e-20'])

p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
weight_field='density',center=c,width=width,data_source=region,north_vector=Up)
p1.save("OAProjDens_Region_{0:03d}.png".format(nout))

p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
weight_field='density',center=c,width=width,data_source=d20,north_vector=Up)
p1.save("OAProjDens_D20_{0:03d}.png".format(nout))

The first OA Projection is generated correctly, but the second one crashes
with the message:

yt : [INFO     ] 2018-02-12 22:20:08,915 Making a fixed resolution buffer
of (('gas', 'density')) 800 by 800
yt : [INFO     ] 2018-02-12 22:22:05,737 Saving plot
OAProjDens_Region_001.png
yt : [INFO     ] 2018-02-12 22:22:06,641 xlim = -0.2 0.2
yt : [INFO     ] 2018-02-12 22:22:06,641 ylim = -0.2 0.2
yt : [INFO     ] 2018-02-12 22:22:06,641 zlim = -0.500000 0.500000
yt : [INFO     ] 2018-02-12 22:23:58,431 Making a fixed resolution buffer
of (('gas', 'density')) 800 by 800
Traceback (most recent call last):
  File "MakeOffAxisProjClouds.py", line 176, in <module>
    p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
weight_field='density',center=c,width=width,data_source=d20,north_vector=Up)
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 1727, in __init__
    fontsize=fontsize)
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 660, in __init__
    PlotWindow.__init__(self, *args, **kwargs)
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 219, in __init__
    self._setup_plots()
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 748, in _setup_plots
    self._recreate_frb()
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 1733, in _recreate_frb
    super(OffAxisProjectionPlot, self)._recreate_frb()
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
line 272, in _recreate_frb
    self._frb._get_data_source_fields()
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/fixed_resolution.py",
line 155, in _get_data_source_fields
    self[f]
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/fixed_resolution.py",
line 543, in __getitem__
    method=dd.method)
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/volume_rendering/off_axis_projection.py",
line 189, in off_axis_projection
    for i, (grid, mask) in enumerate(data_source.blocks):
  File
"/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/data_objects/selection_data_containers.py",
line 836, in blocks
    with obj._field_parameter_state(self.field_parameters):
AttributeError: 'OctreeSubsetBlockSlicePosition' object has no attribute
'_field_parameter_state'

I'm trying to find how to have d20 inherit _field_parameter_state from
region, but thought someone might be able to point me in the right
direction a bit faster.

Thanks!
   -Mark

--

Mark Richardson
MAT Postdoctoral Fellow
Department of Astrophysics
American Museum of Natural History
Mark.Richardson.Work@gmail.com
My Website <https://sites.google.com/site/marklarichardson/>
212 496 3432

--001a1148215464247f05650bb037
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><font size=3D"4">Hey, I&#39;ve previously been able t=
o make off-axis projections of ramses datasets with geometric data containe=
rs. However, I&#39;ve recently tried to do this with a cut_region for dens =
gas, without success. Here is a script that should work with a ramses cosmo=
 dataset:<br></font><br><span style=3D"font-family:monospace,monospace">imp=
ort yt<br>import numpy as np<br><br>num =3D 1<br>Look =3D [1.,1.,0]<br>Up =
=3D [0.,1.,1.]<br><br></span><br><span style=3D"font-family:monospace,monos=
pace"><span style=3D"font-family:monospace,monospace">c =3D np.array([0.5,0=
.5,0.5])<br>rad =3D 0.2<br></span></span><span style=3D"font-family:monospa=
ce,monospace"><span style=3D"font-family:monospace,monospace"><span style=
=3D"font-family:monospace,monospace">width =3D 2*rad<br></span>extra =3D 1.=
05<br></span></span><span style=3D"font-family:monospace,monospace"><span s=
tyle=3D"font-family:monospace,monospace">left =C2=A0=3D c - rad*extra<br>ri=
ght =3D c + rad*extra<br>bb =3D [left,right]<br><br></span>fn =3D &quot;../=
output_{0:05d}/info_{0:05d}.txt&quot;<br>ds =3D yt.load(fn.format(num),bbox=
=3Dbb)<br><br>region =3D ds.region(c,left,right)<br><br>d20 =3D region.cut_=
region([&#39;obj[&quot;density&quot;] &gt; 1e-20&#39;])<br><br>p1 =3D yt.Of=
fAxisProjectionPlot(ds,Look,&quot;density&quot;, weight_field=3D&#39;densit=
y&#39;,center=3Dc,width=3Dwidth,data_source=3Dregion,north_vector=3DUp)<br>=
p1.save(&quot;OAProjDens_Region_{0:03d}.png&quot;.format(nout))<br><br>p1 =
=3D yt.OffAxisProjectionPlot(ds,Look,&quot;density&quot;, weight_field=3D&#=
39;density&#39;,center=3Dc,width=3Dwidth,data_source=3Dd20,north_vector=3DU=
p)<br>p1.save(&quot;OAProjDens_D20_{0:03d}.png&quot;.format(nout))</span><b=
r><br></div><font size=3D"4">The first OA Projection is generated correctly=
, but the second one crashes with the message: </font><span style=3D"font-f=
amily:monospace,monospace"><br><br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02-12 22=
:20:08,915 Making a fixed resolution buffer of ((&#39;gas&#39;, &#39;densit=
y&#39;)) 800 by 800<br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02-12 22:22:05,737 S=
aving plot OAProjDens_Region_001.png<br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02-=
12 22:22:06,641 xlim =3D -0.2 0.2<br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02-12 =
22:22:06,641 ylim =3D -0.2 0.2<br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02-12 22:=
22:06,641 zlim =3D -0.500000 0.500000<br>yt : [INFO =C2=A0 =C2=A0 ] 2018-02=
-12 22:23:58,431 Making a fixed resolution buffer of ((&#39;gas&#39;, &#39;=
density&#39;)) 800 by 800<br>Traceback (most recent call last):<br>=C2=A0 F=
ile &quot;MakeOffAxisProjClouds.py&quot;, line 176, in &lt;module&gt;<br>=
=C2=A0 =C2=A0 p1 =3D yt.OffAxisProjectionPlot(ds,Look,&quot;density&quot;, =
weight_field=3D&#39;density&#39;,center=3Dc,width=3Dwidth,data_source=3Dd20=
,north_vector=3DUp)<br>=C2=A0 File &quot;/mnt/blackwhale/home/mrichard/soft=
/yt/yt_cphyc/yt/visualization/plot_window.py&quot;, line 1727, in __init__<=
br>=C2=A0 =C2=A0 fontsize=3Dfontsize)<br>=C2=A0 File &quot;/mnt/blackwhale/=
home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py&quot;, line =
660, in __init__<br>=C2=A0 =C2=A0 PlotWindow.__init__(self, *args, **kwargs=
)<br>=C2=A0 File &quot;/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/vi=
sualization/plot_window.py&quot;, line 219, in __init__<br>=C2=A0 =C2=A0 se=
lf._setup_plots()<br>=C2=A0 File &quot;/mnt/blackwhale/home/mrichard/soft/y=
t/yt_cphyc/yt/visualization/plot_window.py&quot;, line 748, in _setup_plots=
<br>=C2=A0 =C2=A0 self._recreate_frb()<br>=C2=A0 File &quot;/mnt/blackwhale=
/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py&quot;, line=
 1733, in _recreate_frb<br>=C2=A0 =C2=A0 super(OffAxisProjectionPlot, self)=
._recreate_frb()<br>=C2=A0 File &quot;/mnt/blackwhale/home/mrichard/soft/yt=
/yt_cphyc/yt/visualization/plot_window.py&quot;, line 272, in _recreate_frb=
<br>=C2=A0 =C2=A0 self._frb._get_data_source_fields()<br>=C2=A0 File &quot;=
/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/fixed_resol=
ution.py&quot;, line 155, in _get_data_source_fields<br>=C2=A0 =C2=A0 self[=
f]<br>=C2=A0 File &quot;/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/v=
isualization/fixed_resolution.py&quot;, line 543, in __getitem__<br>=C2=A0 =
=C2=A0 method=3Ddd.method)<br>=C2=A0 File &quot;/mnt/blackwhale/home/mricha=
rd/soft/yt/yt_cphyc/yt/visualization/volume_rendering/off_axis_projection.p=
y&quot;, line 189, in off_axis_projection<br>=C2=A0 =C2=A0 for i, (grid, ma=
sk) in enumerate(data_source.blocks):<br>=C2=A0 File &quot;/mnt/blackwhale/=
home/mrichard/soft/yt/yt_cphyc/yt/data_objects/selection_data_containers.py=
&quot;, line 836, in blocks<br>=C2=A0 =C2=A0 with obj._field_parameter_stat=
e(self.field_parameters):<br>AttributeError: &#39;OctreeSubsetBlockSlicePos=
ition&#39; object has no attribute &#39;_field_parameter_state&#39;</span><=
br><div><div><br></div><div><font size=3D"4">I&#39;m trying to find how to =
have d20 inherit _field_parameter_state from region, but thought someone mi=
ght be able to point me in the right direction a bit faster. <br><br></font=
></div><div><font size=3D"4">Thanks!<br></font></div><div>=C2=A0=C2=A0<font=
 size=3D"4"> -Mark</font><br></div><div><br>-- <br><div class=3D"gmail_sign=
ature"><div dir=3D"ltr"><div><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"=
ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><br><span style=3D"=
font-size:12.8px">Mark Richardson</span><br style=3D"font-size:12.8px"><div=
 style=3D"font-size:small"><span style=3D"font-size:12.8px">MAT Postdoctora=
l Fellow</span><div style=3D"font-size:12.8px">Department of Astrophysics</=
div><div><span style=3D"font-size:12.8px">American Museum of Natural Histor=
y</span><div style=3D"font-size:12.8px"><a href=3D"mailto:Mark.Richardson.W=
ork@gmail.com" style=3D"color:rgb(17,85,204)" target=3D"_blank">Mark.Richar=
dson.Work@gmail.com</a></div><div><a href=3D"https://sites.google.com/site/=
marklarichardson/
" style=3D"color:rgb(17,85,204)" target=3D"_blank">My Webs=
ite</a><br><div style=3D"font-size:12.8px">212 496 3432</div></div></div></=
div></div></div></div></div></div></div></div></div></div>
</div></div></div>

--001a1148215464247f05650bb037--

------------------------------

Date: Mon, 12 Feb 2018 18:37:46 -0600
From: Nathan Goldbaum <nathan12343@gmail.com>
Subject: [yt-dev] Re: OctTree cut_region OffAxis Projections
To: yt-dev@python.org
Message-ID:
        <CAJXewO=eL-F5FtrpY83ddkN=_fh+MC1=Wqadx2bR0=cQrxmvZg@mail.gmail.com>
Content-Type: multipart/alternative;
        boundary="94eb2c0eeff24e015605650d35ca"

--94eb2c0eeff24e015605650d35ca
Content-Type: text/plain; charset="UTF-8"

Hi Mark,

This is caused by the fact that OctreeSubsetBlockSlicePosition is not a
subclass of YTSelectionContainer, which implements the appropriate API.

I don't remember offhand why it's designed that way. The fix would either
be to make OctreeSubsetBlockSlicePosition inherit from YTSelectionContainer
(no idea how hard this would be or what it would break to do that) or
simply implement the _field_parameter_state context manager for the
OctreeSubsetBlockSlicePosition class.

For reference, here's the implementation of the field_parameter_state
context manager for the base data object class:

https://github.com/yt-project/yt/blob/master/yt/data_objects/data_containers.py#L1084

If you want to take this on to fix the issue you're running into then
that's great. If not then I'd be happy to take a look at this this week.
For the latter option, it would be great if you could file an issue for
this, along with a script that triggers this problem and makes use of one
of the public RAMSES test datasets we have on yt-project.org/data. That
will make it easier for me to start on the fix.

-Nathan


On Mon, Feb 12, 2018 at 4:56 PM Mark Richardson <mark.richardson.work@gmail.
com> wrote:

> Hey, I've previously been able to make off-axis projections of ramses
> datasets with geometric data containers. However, I've recently tried to do
> this with a cut_region for dens gas, without success. Here is a script that
> should work with a ramses cosmo dataset:
>
> import yt
> import numpy as np
>
> num = 1
> Look = [1.,1.,0]
> Up = [0.,1.,1.]
>
>
> c = np.array([0.5,0.5,0.5])
> rad = 0.2
> width = 2*rad
> extra = 1.05
> left  = c - rad*extra
> right = c + rad*extra
> bb = [left,right]
>
> fn = "../output_{0:05d}/info_{0:05d}.txt"
> ds = yt.load(fn.format(num),bbox=bb)
>
> region = ds.region(c,left,right)
>
> d20 = region.cut_region(['obj["density"] > 1e-20'])
>
> p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
> weight_field='density',center=c,width=width,data_source=
> region,north_vector=Up)
> p1.save("OAProjDens_Region_{0:03d}.png".format(nout))
>
> p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
> weight_field='density',center=c,width=width,data_source=d20,
> north_vector=Up)
> p1.save("OAProjDens_D20_{0:03d}.png".format(nout))
>
> The first OA Projection is generated correctly, but the second one crashes
> with the message:
>
> yt : [INFO     ] 2018-02-12 22:20:08,915 Making a fixed resolution buffer
> of (('gas', 'density')) 800 by 800
> yt : [INFO     ] 2018-02-12 22:22:05,737 Saving plot
> OAProjDens_Region_001.png
> yt : [INFO     ] 2018-02-12 22:22:06,641 xlim = -0.2 0.2
> yt : [INFO     ] 2018-02-12 22:22:06,641 ylim = -0.2 0.2
> yt : [INFO     ] 2018-02-12 22:22:06,641 zlim = -0.500000 0.500000
> yt : [INFO     ] 2018-02-12 22:23:58,431 Making a fixed resolution buffer
> of (('gas', 'density')) 800 by 800
> Traceback (most recent call last):
>   File "MakeOffAxisProjClouds.py", line 176, in <module>
>     p1 = yt.OffAxisProjectionPlot(ds,Look,"density",
> weight_field='density',center=c,width=width,data_source=d20,
> north_vector=Up)
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 1727, in __init__
>     fontsize=fontsize)
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 660, in __init__
>     PlotWindow.__init__(self, *args, **kwargs)
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 219, in __init__
>     self._setup_plots()
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 748, in _setup_plots
>     self._recreate_frb()
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 1733, in _recreate_frb
>     super(OffAxisProjectionPlot, self)._recreate_frb()
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/visualization/plot_window.py",
> line 272, in _recreate_frb
>     self._frb._get_data_source_fields()
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/
> visualization/fixed_resolution.py", line 155, in _get_data_source_fields
>     self[f]
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/
> visualization/fixed_resolution.py", line 543, in __getitem__
>     method=dd.method)
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/
> visualization/volume_rendering/off_axis_projection.py", line 189, in
> off_axis_projection
>     for i, (grid, mask) in enumerate(data_source.blocks):
>   File "/mnt/blackwhale/home/mrichard/soft/yt/yt_cphyc/yt/
> data_objects/selection_data_containers.py", line 836, in blocks
>     with obj._field_parameter_state(self.field_parameters):
> AttributeError: 'OctreeSubsetBlockSlicePosition' object has no attribute
> '_field_parameter_state'
>
> I'm trying to find how to have d20 inherit _field_parameter_state from
> region, but thought someone might be able to point me in the right
> direction a bit faster.
>
> Thanks!
>    -Mark
>
> --
>
> Mark Richardson
> MAT Postdoctoral Fellow
> Department of Astrophysics
> American Museum of Natural History
> Mark.Richardson.Work@gmail.com
> My Website <https://sites.google.com/site/marklarichardson/>
> 212 496 3432 <(212)%20496-3432>
> _______________________________________________
> yt-dev mailing list -- yt-dev@python.org
> To unsubscribe send an email to yt-dev-leave@python.org
> _______________________________________________
> yt-dev mailing list -- yt-dev@python.org
> To unsubscribe send an email to yt-dev-leave@python.org
>

--94eb2c0eeff24e015605650d35ca
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div dir=3D"auto">Hi Mark,</div><br></div><div>This i=
s caused by the fact that OctreeSubsetBlockSlicePosition is not a subclass =
of YTSelectionContainer, which implements the appropriate API.<br><br></div=
><div>I don&#39;t remember offhand why it&#39;s designed that way. The fix =
would either be to make OctreeSubsetBlockSlicePosition inherit from YTSelec=
tionContainer (no idea how hard this would be or what it would break to do =
that) or simply implement the _field_parameter_state context manager for th=
e OctreeSubsetBlockSlicePosition class.<br><br></div><div>For reference, he=
re&#39;s the implementation of the field_parameter_state context manager fo=
r the base data object class:<br><br><a href=3D"https://github.com/yt-proje=
ct/yt/blob/master/yt/data_objects/data_containers.py#L1084
">https://github.=
com/yt-project/yt/blob/master/yt/data_objects/data_containers.py#L1084</a><=
br><br></div><div>If you want to take this on to fix the issue you&#39;re r=
unning into then that&#39;s great. If not then I&#39;d be happy to take a l=
ook at this this week. For the latter option, it would be great if you coul=
d file an issue for this, along with a script that triggers this problem an=
d makes use of one of the public RAMSES test datasets we have on <a href=3D=
"http://yt-project.org/data">yt-project.org/data</a>. That will make it eas=
ier for me to start on the fix.<br><br></div><div>-Nathan<br></div><div><br=
></div><div><br><div class=3D"gmail_quote"><div>On Mon, Feb 12, 2018 at 4:5=
6 PM Mark Richardson &lt;<a href=3D"mailto:mark.richardson.work@gmail.com" =
target=3D"_blank">mark.richardson.work@gmail.<wbr>com</a>&gt; wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><font size=
=3D"4">Hey, I&#39;ve previously been able to make off-axis projections of r=
amses datasets with geometric data containers. However, I&#39;ve recently t=
ried to do this with a cut_region for dens gas, without success. Here is a =
script that should work with a ramses cosmo dataset:<br></font><br><span st=
yle=3D"font-family:monospace,monospace">import yt<br>import numpy as np<br>=
<br>num =3D 1<br>Look =3D [1.,1.,0]<br>Up =3D [0.,1.,1.]<br><br></span><br>=
<span style=3D"font-family:monospace,monospace"><span style=3D"font-family:=
monospace,monospace">c =3D np.array([0.5,0.5,0.5])<br>rad =3D 0.2<br></span=
></span><span style=3D"font-family:monospace,monospace"><span style=3D"font=
-family:monospace,monospace"><span style=3D"font-family:monospace,monospace=
">width =3D 2*rad<br></span>extra =3D 1.05<br></span></span><span style=3D"=
font-family:monospace,monospace"><span style=3D"font-family:monospace,monos=
pace">left =C2=A0=3D c - rad*extra<br>right =3D c + rad*extra<br>bb =3D [le=
ft,right]<br><br></span>fn =3D &quot;../output_{0:05d}/info_{0:<wbr>05d}.tx=
t&quot;<br>ds =3D yt.load(fn.format(num),bbox=3D<wbr>bb)<br><br>region =3D =
ds.region(c,left,right)<br><br>d20 =3D region.cut_region([&#39;obj[&quot;<w=
br>density&quot;] &gt; 1e-20&#39;])<br><br>p1 =3D yt.OffAxisProjectionPlot(=
ds,<wbr>Look,&quot;density&quot;, weight_field=3D&#39;density&#39;,center=
=3D<wbr>c,width=3Dwidth,data_source=3D<wbr>region,north_vector=3DUp)<br>p1.=
save(&quot;OAProjDens_Region_{0:<wbr>03d}.png&quot;.format(nout))<br><br>p1=
 =3D yt.OffAxisProjectionPlot(ds,<wbr>Look,&quot;density&quot;, weight_fiel=
d=3D&#39;density&#39;,center=3D<wbr>c,width=3Dwidth,data_source=3Dd20,<wbr>=
north_vector=3DUp)<br>p1.save(&quot;OAProjDens_D20_{0:<wbr>03d}.png&quot;.f=
ormat(nout))</span><br><br></div><font size=3D"4">The first OA Projection i=
s generated correctly, but the second one crashes with the message: </font>=
<span style=3D"font-family:monospace,monospace"><br><br>yt : [INFO =C2=A0 =
=C2=A0 ] 2018-02-12 22:20:08,915 Making a fixed resolution buffer of ((&#39=
;gas&#39;, &#39;density&#39;)) 800 by 800<br>yt : [INFO =C2=A0 =C2=A0 ] 201=
8-02-12 22:22:05,737 Saving plot OAProjDens_Region_001.png<br>yt : [INFO =
=C2=A0 =C2=A0 ] 2018-02-12 22:22:06,641 xlim =3D -0.2 0.2<br>yt : [INFO =C2=
=A0 =C2=A0 ] 2018-02-12 22:22:06,641 ylim =3D -0.2 0.2<br>yt : [INFO =C2=A0=
 =C2=A0 ] 2018-02-12 22:22:06,641 zlim =3D -0.500000 0.500000<br>yt : [INFO=
 =C2=A0 =C2=A0 ] 2018-02-12 22:23:58,431 Making a fixed resolution buffer o=
f ((&#39;gas&#39;, &#39;density&#39;)) 800 by 800<br>Traceback (most recent=
 call last):<br>=C2=A0 File &quot;MakeOffAxisProjClouds.py&quot;, line 176,=
 in &lt;module&gt;<br>=C2=A0 =C2=A0 p1 =3D yt.OffAxisProjectionPlot(ds,<wbr=
>Look,&quot;density&quot;, weight_field=3D&#39;density&#39;,center=3D<wbr>c=
,width=3Dwidth,data_source=3Dd20,<wbr>north_vector=3DUp)<br>=C2=A0 File &qu=
ot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/yt_cphyc/yt/<wbr>visualizatio=
n/plot_window.py&quot;, line 1727, in __init__<br>=C2=A0 =C2=A0 fontsize=3D=
fontsize)<br>=C2=A0 File &quot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/y=
t_cphyc/yt/<wbr>visualization/plot_window.py&quot;, line 660, in __init__<b=
r>=C2=A0 =C2=A0 PlotWindow.__init__(self, *args, **kwargs)<br>=C2=A0 File &=
quot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/yt_cphyc/yt/<wbr>visualizat=
ion/plot_window.py&quot;, line 219, in __init__<br>=C2=A0 =C2=A0 self._setu=
p_plots()<br>=C2=A0 File &quot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/y=
t_cphyc/yt/<wbr>visualization/plot_window.py&quot;, line 748, in _setup_plo=
ts<br>=C2=A0 =C2=A0 self._recreate_frb()<br>=C2=A0 File &quot;/mnt/blackwha=
le/home/<wbr>mrichard/soft/yt/yt_cphyc/yt/<wbr>visualization/plot_window.py=
&quot;, line 1733, in _recreate_frb<br>=C2=A0 =C2=A0 super(OffAxisProjectio=
nPlot, self)._recreate_frb()<br>=C2=A0 File &quot;/mnt/blackwhale/home/<wbr=
>mrichard/soft/yt/yt_cphyc/yt/<wbr>visualization/plot_window.py&quot;, line=
 272, in _recreate_frb<br>=C2=A0 =C2=A0 self._frb._get_data_source_<wbr>fie=
lds()<br>=C2=A0 File &quot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/yt_cp=
hyc/yt/<wbr>visualization/fixed_<wbr>resolution.py&quot;, line 155, in _get=
_data_source_fields<br>=C2=A0 =C2=A0 self[f]<br>=C2=A0 File &quot;/mnt/blac=
kwhale/home/<wbr>mrichard/soft/yt/yt_cphyc/yt/<wbr>visualization/fixed_<wbr=
>resolution.py&quot;, line 543, in __getitem__<br>=C2=A0 =C2=A0 method=3Ddd=
.method)<br>=C2=A0 File &quot;/mnt/blackwhale/home/<wbr>mrichard/soft/yt/yt=
_cphyc/yt/<wbr>visualization/volume_<wbr>rendering/off_axis_projection.<wbr=
>py&quot;, line 189, in off_axis_projection<br>=C2=A0 =C2=A0 for i, (grid, =
mask) in enumerate(data_source.blocks):<br>=C2=A0 File &quot;/mnt/blackwhal=
e/home/<wbr>mrichard/soft/yt/yt_cphyc/yt/<wbr>data_objects/selection_data_<=
wbr>containers.py&quot;, line 836, in blocks<br>=C2=A0 =C2=A0 with obj._fie=
ld_parameter_state(<wbr>self.field_parameters):<br>AttributeError: &#39;<wb=
r>OctreeSubsetBlockSlicePosition<wbr>&#39; object has no attribute &#39;_fi=
eld_parameter_state&#39;</span><br><div><div><br></div><div><font size=3D"4=
">I&#39;m trying to find how to have d20 inherit _field_parameter_state fro=
m region, but thought someone might be able to point me in the right direct=
ion a bit faster. <br><br></font></div><div><font size=3D"4">Thanks!<br></f=
ont></div><div>=C2=A0=C2=A0<font size=3D"4"> -Mark</font><br></div><div><br=
>-- <br><div class=3D"gmail-m_5724714285761475125m_-6614609091351070164gmai=
l_signature"><div><div><div><div><div><div><div><div><br><span style=3D"fon=
t-size:12.8px">Mark Richardson</span><br style=3D"font-size:12.8px"><div st=
yle=3D"font-size:small"><span style=3D"font-size:12.8px">MAT Postdoctoral F=
ellow</span><div style=3D"font-size:12.8px">Department of Astrophysics</div=
><div><span style=3D"font-size:12.8px">American Museum of Natural History</=
span><div style=3D"font-size:12.8px"><a href=3D"mailto:Mark.Richardson.Work=
@gmail.com" style=3D"color:rgb(17,85,204)" target=3D"_blank">Mark.Richardso=
n.Work@gmail.com</a></div><div><a href=3D"https://sites.google.com/site/mar=
klarichardson/
" style=3D"color:rgb(17,85,204)" target=3D"_blank">My Website=
</a><br><div style=3D"font-size:12.8px"><a href=3D"tel:(212)%20496-3432" va=
lue=3D"+12124963432" target=3D"_blank">212 496 3432</a></div></div></div></=
div></div></div></div></div></div></div></div></div></div>
</div></div></div>
______________________________<wbr>_________________<br>
yt-dev mailing list -- <a href=3D"mailto:yt-dev@python.org" target=3D"_blan=
k">yt-dev@python.org</a><br>
To unsubscribe send an email to <a href=3D"mailto:yt-dev-leave@python.org" =
target=3D"_blank">yt-dev-leave@python.org</a><br>
______________________________<wbr>_________________<br>
yt-dev mailing list -- <a href=3D"mailto:yt-dev@python.org" target=3D"_blan=
k">yt-dev@python.org</a><br>
To unsubscribe send an email to <a href=3D"mailto:yt-dev-leave@python.org" =
target=3D"_blank">yt-dev-leave@python.org</a><br>
</blockquote></div></div></div>

--94eb2c0eeff24e015605650d35ca--

------------------------------

Subject: Digest Footer

_______________________________________________
yt-dev mailing list -- yt-dev@python.org
To unsubscribe send an email to yt-dev-leave@python.org


------------------------------

End of yt-dev Digest, Vol 110, Issue 5
**************************************

--

Mark Richardson
MAT Postdoctoral Fellow
Department of Astrophysics
American Museum of Natural History
My Website
212 496 3432