<div dir="ltr">Hi again,<div><br></div><div>I think I figured out why the Camera wasn't liking the Projection transfer function. I don't necessarily want this to be the fix, but I think this diff will at least let Camera work, and in principle I think that will filter down to the PerspectiveCamera.</div>

<div><br></div><div><a href="http://paste.yt-project.org/show/4258/">http://paste.yt-project.org/show/4258/</a><br></div><div><br></div><div>Can you give that a shot?  If that works, I can spend some time thinking about how this should actually be plugged in.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 7:58 AM, Munier Azzam Salem <span dir="ltr"><<a href="mailto:msalem@astro.columbia.edu" target="_blank">msalem@astro.columbia.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Sam,<div><br></div><div>     Thanks for the options! Ultimately, I'd like to use a PerspectiveCamera object to do these projections (I'd like to do a non-orthographic projection, using rays that converge to a focal point ... which is what pulled me away from standard OffAxisProjections in the first place). </div>


<div><br></div><div>Do you think it's easy for me to copy and modify the ProjectionCamera class to either inherit from ProjectionCamera, rather than Camera?</div><span class="HOEnZb"><font color="#888888"><div><br></div>

<div>Munier</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Jan 29, 2014 at 10:42 AM, Sam Skillman <span dir="ltr"><<a href="mailto:samskillman@gmail.com" target="_blank">samskillman@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr">Hi Munier,<div><br></div><div>I can reproduce the issue you see there using the Camera interface, and am not sure at the moment why that doesn't work. However, there are several alternate methods that may be more useful that are constructed specifically for off axis projections.</div>





<div><br></div><div>The first is the off_axis_projection function:</div><div><a href="http://yt-project.org/docs/dev/visualizing/plots.html#off-axis-projection-plots" target="_blank">http://yt-project.org/docs/dev/visualizing/plots.html#off-axis-projection-plots</a><br>





</div><div><br></div><div>A while back this was wrapped with an OffAxisProjectionPlot Plot-window interface, which can been seen just below the example linked to above.  </div><div><br></div><div>Finally, you could use the ProjectionCamera class, which inherits a lot of characteristics from the Camera class.  Here's an example on how to run it (modified version of your code above):</div>





<div><a href="http://paste.yt-project.org/show/4257/" target="_blank">http://paste.yt-project.org/show/4257/</a><br></div><div><br></div><div>Note that the off_axis_projection function actually just wraps the ProjectionCamera class, and OffAxisProjectionPlot wraps off_axis_projection, so it's all the same underneath.</div>




<div><br></div><div>Let us know if that works. I'd suggest you go with the OffAxisProjectionPlot interface since it is meant to be similar to the SlicePlot/ProjectionPlot.</div><div><br></div><div>Sam</div></div><div class="gmail_extra">




<br><br><div class="gmail_quote"><div><div>On Wed, Jan 29, 2014 at 7:13 AM, Munier Azzam Salem <span dir="ltr"><<a href="mailto:msalem@astro.columbia.edu" target="_blank">msalem@astro.columbia.edu</a>></span> wrote:<br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>

<div dir="ltr">Hey Guys,<div><br></div><div>     I'm trying to get simple projections, but using the Camera interface, to allow skewed perspectives. I've tried simply allowing the camera to use the default ProjectionTransferFunction, in lieu of prettier color transfer functions ... this seems to yield an all-black image. I've also tried explicitly setting it's bounds (both with log and non-log limits). This doesn't seem to help. I see this issue came up about a year ago <a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2013-January/003285.html" target="_blank">here</a>.</div>





<div><br></div><div>       My script's included below. I'm tempted to just tweak my inputs to the color trasnfer function to mimic a simple projection.</div><div><br></div><div>         thanks!</div><div>             Munier</div>





<div><br></div><div>My script:</div><div><font face="courier new, monospace" size="1"><b><br></b></font></div><div><div><font face="courier new, monospace" size="1"><b>from yt.mods import *</b></font></div><div><font face="courier new, monospace" size="1"><b>import yt.visualization.volume_rendering.api as vr</b></font></div>





<div><font face="courier new, monospace" size="1"><b>from yt.visualization.volume_rendering.transfer_functions import ProjectionTransferFunction as PTF</b></font></div><div><font face="courier new, monospace" size="1"><b><br>





</b></font></div><div><font face="courier new, monospace" size="1"><b>pf = load("DD0179/DD0179")</b></font></div><div><font face="courier new, monospace" size="1"><b>field = 'Density'</b></font></div><div>





<font face="courier new, monospace" size="1"><b>use_log = True</b></font></div><div><font face="courier new, monospace" size="1"><b><br></b></font></div><div><font face="courier new, monospace" size="1"><b># Find the bounds in log space of for your field</b></font></div>





<div><font face="courier new, monospace" size="1"><b>dd = pf.h.all_data()</b></font></div><div><font face="courier new, monospace" size="1"><b>limits = np.array(dd.quantities["Extrema"](field)[0]) * pf.units['cm']</b></font></div>





<div><font face="courier new, monospace" size="1"><b><br></b></font></div><div><font face="courier new, monospace" size="1"><b>#if use_log:</b></font></div><div><font face="courier new, monospace" size="1"><b>#    limits = np.log(limits)</b></font></div>





<div><font face="courier new, monospace" size="1"><b><br></b></font></div><div><font face="courier new, monospace" size="1"><b># Set up the camera parameters: center, looking direction, width, resolution</b></font></div>




<div>
<font face="courier new, monospace" size="1"><b>c = np.array([.333]*3)</b></font></div><div><font face="courier new, monospace" size="1"><b>L = np.array([1.0, 1.0, 1.0])</b></font></div><div><font face="courier new, monospace" size="1"><b>W = 0.3 / pf["unitary"]</b></font></div>





<div><font face="courier new, monospace" size="1"><b>N = 1028</b></font></div><div><font face="courier new, monospace" size="1"><b><br></b></font></div><div><font face="courier new, monospace" size="1"><b># Create a camera object</b></font></div>





<div><font face="courier new, monospace" size="1"><b>cam = vr.Camera(c, L, W, (N,N), transfer_function=PTF(limits),pf=pf)</b></font></div><div><font face="courier new, monospace" size="1"><b>im = cam.snapshot('density.png')</b></font></div>




<span><font color="#888888">
<div><br></div>-- <br>Munier A. Salem // <a href="tel:845.489.6450" value="+18454896450" target="_blank">845.489.6450</a>
</font></span></div></div>
<br></div></div>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div><br></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></blockquote></div><br><br clear="all"><div><br></div>-- <br>Munier A. Salem // <a href="tel:845.489.6450" value="+18454896450" target="_blank">845.489.6450</a>
</div>
</div></div><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></blockquote></div><br></div>