Also, you might want to change:<br><br>reg = pf.h.region([0.5, 0.5, 0.5], [0.4875, 0.0, 0.0], [5.125, 1.0, 
1.0])<br><br>to:<br><br>reg = pf.h.region([0.5, 0.5, 0.5], [0.4875, 0.0, 0.0], [0.5125, 1.0, 
1.0])<br><br>(note the change of 5.125 to 0.5125).  That's probably causing hilarity.<br><br>B<br><br><div class="gmail_quote">On Mon, Mar 22, 2010 at 4:57 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Shankar,<br>
<br>
You're almost there!  :)<br>
<br>
Try:<br>
<br>
--<br>
<div class="im">from yt.mods import *<br>
<br>
fn = "RedshiftOutput0001"<br>
pf = load(fn) # load data<br>
<br>
reg = pf.h.region([0.5, 0.5, 0.5], [0.4875, 0.0, 0.0], [5.125, 1.0, 1.0])<br>
</div><div class="im">pc = PlotCollection(reg1,center=[0.5,0.5,0.5])<br>
</div>p = pc.add_projection("Dark_Matter_Density", ax, source=reg)<br>
pc.save()<br>
<font color="#888888">--<br>
<br>
It's a bit subtle that data_source supplied to add_projection will do<br>
something different from source=.<br>
<br>
-Matt<br>
</font><div><div></div><div class="h5"><br>
<br>
On Mon, Mar 22, 2010 at 1:55 PM, Agarwal, Shankar <<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>> wrote:<br>
> Hi,<br>
><br>
> I need assistance on this.<br>
><br>
> I tried taking a density projection of 1/40th (in code units) of the box thickness using the following code. But It gives me the projection of the entire box.<br>
><br>
><br>
> from yt.mods import *<br>
><br>
> fn = "RedshiftOutput0001"<br>
> pf = load(fn) # load data<br>
><br>
> reg = pf.h.region([0.5, 0.5, 0.5], [0.4875, 0.0, 0.0], [5.125, 1.0, 1.0])<br>
> pf.h.save_object(reg, "region")<br>
><br>
> reg1 = pf.h.load_object("region")<br>
><br>
> pc = PlotCollection(reg1,center=[0.5,0.5,0.5])<br>
><br>
> for ax in range(1):<br>
>  p = pc.add_projection("Dark_Matter_Density", ax)<br>
> pc.save()<br>
><br>
><br>
> I will appreciate if somenone can tell me how may I take the projection of the AMR3dDATA object: reg1<br>
><br>
><br>
> Shankar<br>
><br>
><br>
> -----Original Message-----<br>
> From: <a href="mailto:yt-users-bounces@lists.spacepope.org">yt-users-bounces@lists.spacepope.org</a> on behalf of Matthew Turk<br>
> Sent: Mon 3/22/2010 1:46 PM<br>
> To: Discussion of the yt analysis package<br>
> Subject: Re: [yt-users] DM density field Slice<br>
><br>
> Hi Shankar,<br>
><br>
> Not sure I know what you mean by thick slice -- we're back on baryon<br>
> quantities, not on the particle rectangular prisms when using<br>
> Dark_Matter_Density -- but I think the answer is that it might end up<br>
> being more complicated than just replacing values.  IF you want to<br>
> project only a portion of the simulation, that can be done by<br>
> specifying a source argument to the projection routine, where the<br>
> source is any AMR3dData object -- like spheres, prisms, etc etc.<br>
> That's the only mechanism available for thick slicing; for slicing you<br>
> can also provide source arguments (I think ... you could at one<br>
> point!) but it will simply slice through that region, not do any<br>
> combinations.<br>
><br>
> -Matt<br>
><br>
> On Mon, Mar 22, 2010 at 11:39 AM, Agarwal, Shankar <<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>> wrote:<br>
>> Matt,<br>
>><br>
>> That makes sense. So, for a thick slice, I will be able to find cells with non-zero density and fill the white spaces. Is it possible to specify the width in code units to the slice or projection routines?<br>
>><br>
>> Shankar<br>
>><br>
>><br>
>> -----Original Message-----<br>
>> From: <a href="mailto:yt-users-bounces@lists.spacepope.org">yt-users-bounces@lists.spacepope.org</a> on behalf of Matthew Turk<br>
>> Sent: Mon 3/22/2010 1:07 PM<br>
>> To: Discussion of the yt analysis package<br>
>> Subject: Re: [yt-users] DM density field Slice<br>
>><br>
>> Hi Shankar,<br>
>><br>
>> This is something that Enzo actually does -- the Dark_Matter_Density<br>
>> is generated via the cic_deposit routines, which are cloud-in-cell<br>
>> interpolation.  Where no particles contribute, it gets marked as zero,<br>
>> which shows up as "bad values" in the log slice, and so it marks them<br>
>> as white.  Looks like everything in this image is working!<br>
>><br>
>> -Matt<br>
>><br>
>> On Mon, Mar 22, 2010 at 11:06 AM, Agarwal, Shankar <<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>> wrote:<br>
>>> Hi Matt,<br>
>>><br>
>>> I just plotted a slice of Dark_Matter_Density. It looks ok except that there are some white patches (the density legend is VIBGYOR)<br>
>>><br>
>>> <a href="http://drop.io/Dark_Matter_Density#" target="_blank">http://drop.io/Dark_Matter_Density#</a><br>
>>><br>
>>><br>
>>> It looks like those white patches are regions from where the density data was not read. Any thoughts?<br>
>>><br>
>>><br>
>>> Shankar<br>
>>><br>
>>> -----Original Message-----<br>
>>> From: <a href="mailto:yt-users-bounces@lists.spacepope.org">yt-users-bounces@lists.spacepope.org</a> on behalf of Matthew Turk<br>
>>> Sent: Mon 3/22/2010 11:58 AM<br>
>>> To: Discussion of the yt analysis package<br>
>>> Subject: Re: [yt-users] DM particles or baryon density field ?<br>
>>><br>
>>> Yup, you're right.<br>
>>><br>
>>> On Mon, Mar 22, 2010 at 9:57 AM, Agarwal, Shankar <<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>> wrote:<br>
>>>> Yes, "Dark_Matter_Density field projections and slices" is what I meant. I will try replacing "Density" with "Dark_Matter_Density".<br>
>>>><br>
>>>><br>
>>>> Also, let me know if I am right...<br>
>>>><br>
>>>> p = pc.add_projection("Density", 0)    ------- This is baryon density field.<br>
>>>><br>
>>>> p.modify["nparticles"](1.0)            ------- But this is DM particles (since there is no baryon particles dataset ?).<br>
>>>><br>
>>>><br>
>>>> Shankar<br>
>>>><br>
>>>><br>
>>>><br>
>>>><br>
>>>> -----Original Message-----<br>
>>>> From: <a href="mailto:yt-users-bounces@lists.spacepope.org">yt-users-bounces@lists.spacepope.org</a> on behalf of Matthew Turk<br>
>>>> Sent: Mon 3/22/2010 11:32 AM<br>
>>>> To: Discussion of the yt analysis package<br>
>>>> Subject: Re: [yt-users] DM particles or baryon density field ?<br>
>>>><br>
>>>> Hi Shankar,<br>
>>>><br>
>>>> I guess the question is sort of ill-defined.  Dark matter is<br>
>>>> discretized as particles; the idea of projecting dark matter is not<br>
>>>> the same as projecting a field quantity.  The same goes for plotting<br>
>>>> slices.<br>
>>>><br>
>>>> However, you can make dark matter plots.  You cna use the<br>
>>>> "add_particles" method on the PlotCollection, which accepts an axis<br>
>>>> and a width -- what it does is plot all the particles within that<br>
>>>> rectangular prism.  This can be mocked up as a projection by setting<br>
>>>> the width equal to the domain width along that axis.<br>
>>>><br>
>>>> You can also try using "Dark_Matter_Density", which might be easier to<br>
>>>> visualize, as a projection or a slice.<br>
>>>><br>
>>>> If you run into any problems with the particle plot, let us know --<br>
>>>> it's not as well-used as the other plots, so there might be subtle<br>
>>>> bugs.  :)<br>
>>>><br>
>>>> -Matt<br>
>>>><br>
>>>> On Mon, Mar 22, 2010 at 9:27 AM, Agarwal, Shankar <<a href="mailto:sagarwal@ku.edu">sagarwal@ku.edu</a>> wrote:<br>
>>>>> Hi,<br>
>>>>><br>
>>>>> The projection, slice, velocity and overplot particles routines: They read the DM particles or gas ?<br>
>>>>><br>
>>>>> Looking at the density legend, it looks like this is baryon density field.<br>
>>>>><br>
>>>>> Is there a provision to plot projection and slice for DM ?<br>
>>>>><br>
>>>>><br>
>>>>> Also, I get this error when overplotting particles...<br>
>>>>><br>
>>>>> yt         INFO       2010-03-22 12:17:44,051 Created plot collection with default plot-center = [0.5, 0.5, 0.5]<br>
>>>>> yt         INFO       2010-03-22 12:17:44,144 Getting the binary hierarchy<br>
>>>>> yt         INFO       2010-03-22 12:17:44,153 Finished with binary hierarchy reading<br>
>>>>> yt         INFO       2010-03-22 12:17:46,108 Added slice of Density at x = 0.5 with 'center' = [0.5, 0.5, 0.5]<br>
>>>>> Traceback (most recent call last):<br>
>>>>>  File "slice.py", line 42, in <module><br>
>>>>>    p.modify["nparticles"](0.005)<br>
>>>>>  File "/autohome/u118/agarwa23/yt-x86_64/src/yt-1.6/yt/raven/PlotTypes.py", line 52, in __getitem__<br>
>>>>>    raise KeyError(item)<br>
>>>>> KeyError: 'nparticles'<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> Shankar<br>
>>>>> _______________________________________________<br>
>>>>> yt-users mailing list<br>
>>>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>>><br>
>>>> _______________________________________________<br>
>>>> yt-users mailing list<br>
>>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> yt-users mailing list<br>
>>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>><br>
>>>><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
>><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br>