Hi Noel,<div><br></div><div>I believe this is a bug that needs to be fixed. It seems MultiVariateTransferFunction was never updated after opaque volume rendering was added.</div><div><br></div><div>Can you please open a new issue about this? <span></span></div>
<div><br></div><div>Nathan<br><br>On Tuesday, July 30, 2013, Noel Scudder wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<div><br></div><div>I'm attempting to visualize multiple variables in the same volume rendering. For instance, I'd like to show some density surfaces of a star and then get temperature overlayed to show hotspots. I found the MultiVariateTransferFunction, but it is unfortunately not particularly well documented yet, and I'm being repeatedly thwarted. I'm not sure if I've set it up correctly, or how to go from the transfer function to an image. Here's my current script, using just one variable for now:</div>
<div><br></div><div>#----------------------------------</div><div>from yt.mods import *</div><div>pf = load('plt00100')</div><div><div><br></div><div>#<some constants></div><div> </div><div>pf.h</div>
<div>pf.field_info['density'].take_log=True</div><div><br></div><div>mv = MultiVariateTransferFunction()</div><div> </div><div>tf = TransferFunction((mi-1, ma+1), nbins=1.0e6)</div></div><div>tf.add_gaussian(np.log10(9.0e5), 0.01, 1.0)</div>
<div><br></div><div>mv.add_field_table(tf, 0)</div><div>mv.link_channels(0, [0,1,2,3])</div><div><br></div><div>c = [5.0e9, 5.0e9, 5.0e9]</div><div>L = [0.15, 1.0, 0.40]</div><div>W = wi*0.7</div><div>Nvec = 1024</div><div>
<br></div><div><div>cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = mv,</div><div> fields=['density'], pf=pf, no_ghost=True)</div></div><div><br></div><div>im = cam.snapshot(num_threads=4)</div>
<div><br></div><div>im.write_png('plt00100.png' )</div><div>#----------------------------------</div><div><br></div><div>I checked to make sure density is indeed my 0-index field. I get the following error after ray casting:</div>
<div><br></div><div><div>Traceback (most recent call last):</div><div> File "<stdin>", line 1, in <module></div><div> File "multivol.py", line 153, in <module></div><div> im = cam.snapshot(num_threads=4)</div>
<div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 742, in snapshot</div><div> image, sampler),</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 632, in _render</div>
<div> image = self.finalize_image(image)</div><div> File "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py", line 611, in finalize_image</div><div> if self.transfer_function.grey_opacity is False:</div>
<div>AttributeError: 'MultiVariateTransferFunction' object has no attribute 'grey_opacity'</div></div><div><br></div><div><br></div><div>Can I not use snapshot in this case, or is something else the matter entirely?</div>
<div><br></div><div>Thanks,</div><div>Noel Scudder</div>
</blockquote></div>