<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 1, 2013 at 10:49 PM, <span dir="ltr"><<a href="mailto:yt-users-request@lists.spacepope.org" target="_blank">yt-users-request@lists.spacepope.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send yt-users mailing list submissions to<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<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>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:yt-users-request@lists.spacepope.org">yt-users-request@lists.spacepope.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:yt-users-owner@lists.spacepope.org">yt-users-owner@lists.spacepope.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of yt-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Error with annotate_marker: Unknown property (Nathan Goldbaum)<br>
2. ANN: matplotlib 1.3.0 released (Nathan Goldbaum)<br>
3. Re: MultiVariate volume rendering difficulties (Cameron Hummels)<br>
<br>
<br>
----------------------------------------------------------------------<br></blockquote><div><br></div><div>Hi Nathan,</div><div><br></div><div>Thanks. That's very informative. Would you mind tell me how you found that? I also tried to </div>
<div>search for the allowed keywords for that callback but didn't find any useful information. Just in case</div><div>next time I run into such kind of problems.</div><div><br></div><div>Thank you very much.</div><div>
<br></div><div>Chao</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Message: 1<br>
Date: Thu, 1 Aug 2013 16:35:55 -0700<br>
From: Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
To: Discussion of the yt analysis package<br>
<<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Subject: Re: [yt-users] Error with annotate_marker: Unknown property<br>
Message-ID:<br>
<CAJXewO=<a href="mailto:bQbfRxAFjwR-2Q3Wsb5ZvGJPxwtRsk_Kfqc0zVa1cCg@mail.gmail.com">bQbfRxAFjwR-2Q3Wsb5ZvGJPxwtRsk_Kfqc0zVa1cCg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi Chao,<br>
<br>
For that callback, you're only allowed to specify keyword arguments<br>
accepted by matplotlib.axes.Axes.scatter:<br>
<a href="http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.scatter" target="_blank">http://matplotlib.org/api/axes_api.html#matplotlib.axes.Axes.scatter</a><br>
<br>
or Collection properties:<br>
<a href="http://matplotlib.org/api/collections_api.html#matplotlib.collections.Collection" target="_blank">http://matplotlib.org/api/collections_api.html#matplotlib.collections.Collection</a><br>
<br>
I'd have to look closer to figure out which keyword corresponds to what<br>
you're looking for, but hopefully that leaves you enough information to<br>
figure out how to do what you're trying to do.<br>
<br>
-Nathan<br>
<br>
<br>
On Thu, Aug 1, 2013 at 3:53 PM, Chao Shi <<a href="mailto:shichao116@gmail.com">shichao116@gmail.com</a>> wrote:<br>
<br>
> Hi all,<br>
><br>
> I'm trying to mark some positions with circle on slice and projection<br>
> plot. But it can't recognize arguments used for specifying the property of<br>
> the marker. For example:<br>
><br>
><br>
> >>> p = SlicePlot(pf,'x','Density')<br>
><br>
> >>> p.annotate_marker([0.5]*3,marker='o', plot_args={'color': 'red',<br>
> 'mew': 5})<br>
><br>
> Traceback (most recent call last):<br>
> File "<stdin>", line 1, in <module><br>
> File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",<br>
> line 100, in newfunc<br>
> args[0]._setup_plots()<br>
> File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",<br>
> line 886, in _setup_plots<br>
> self.run_callbacks(f)<br>
> File "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_window.py",<br>
> line 896, in run_callbacks<br>
> callback(cbw)<br>
> File<br>
> "/home/cshi31/yt-x86_64/src/yt-hg/yt/visualization/plot_modifications.py",<br>
> line 777, in __call__<br>
> plot._axes.scatter(x,y, marker = self.marker, **self.plot_args)<br>
> File<br>
> "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/axes.py",<br>
> line 6123, in scatter<br>
> collection.update(kwargs)<br>
> File<br>
> "/home/cshi31/yt-x86_64/lib/python2.7/site-packages/matplotlib/artist.py",<br>
> line 670, in update<br>
> raise AttributeError('Unknown property %s' % k)<br>
> AttributeError: Unknown property mew<br>
><br>
> mew is an alias for markeredgewidth. I also tried with 'markeredgewidth'<br>
> but it gave the same error.<br>
><br>
> Besides, 'mec', 'ms' also can't be recognized. Only 'color' works.<br>
><br>
> Does anyone have a clue about this?<br>
><br>
> Thanks very much.<br>
><br>
> Chao<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>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/fb8c7ad5/attachment-0001.htm" target="_blank">http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/fb8c7ad5/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 1 Aug 2013 18:24:41 -0700<br>
From: Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
To: Discussion of the yt analysis package<br>
<<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Subject: [yt-users] ANN: matplotlib 1.3.0 released<br>
Message-ID:<br>
<<a href="mailto:CAJXewOkcnia2Y6gkO6QN9a2K-%2BXr7_FGTGKLUySFQDjarbnf_w@mail.gmail.com">CAJXewOkcnia2Y6gkO6QN9a2K-+Xr7_FGTGKLUySFQDjarbnf_w@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi all,<br>
<br>
Please see the matplotlib mailing list archives for the release notes and<br>
official announcement e-mail:<br>
<a href="http://matplotlib.1069221.n5.nabble.com/ANN-matplotlib-1-3-0-released-td41670.html" target="_blank">http://matplotlib.1069221.n5.nabble.com/ANN-matplotlib-1-3-0-released-td41670.html</a><br>
<br>
This big new feature for this version is the WebAGG backend, which is a new<br>
plotting interface specially made for the IPython notebook. It also<br>
includes a convenience function that alters the plotting settings to<br>
generate xkcd-style plots.<br>
<br>
There may be some incompatibilities with yt - if anyone notices any issues<br>
please report it on the issue tracker.<br>
<br>
Cheers,<br>
<br>
Nathan<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/a1715c6e/attachment-0001.htm" target="_blank">http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/a1715c6e/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 1 Aug 2013 19:39:02 -0700<br>
From: Cameron Hummels <<a href="mailto:chummels@gmail.com">chummels@gmail.com</a>><br>
To: Discussion of the yt analysis package<br>
<<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a>><br>
Subject: Re: [yt-users] MultiVariate volume rendering difficulties<br>
Message-ID:<br>
<<a href="mailto:CACyTu7ERKuNSgCY3HMQGPXL3UPhRspyUG_r3V8L1-rzxTaPNeQ@mail.gmail.com">CACyTu7ERKuNSgCY3HMQGPXL3UPhRspyUG_r3V8L1-rzxTaPNeQ@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
I agree with Stella's solution, as that's what I've done in the past.<br>
Obviously you can get some blending between the two CTFs, but that's the<br>
point right?<br>
<br>
Cameron<br>
<br>
<br>
On Thu, Aug 1, 2013 at 2:31 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>>wrote:<br>
<br>
> Wow Noel, keep up the awesome work!<br>
><br>
> I'm sure this will be helpful for Sam when he looks at this stuff next<br>
> week.<br>
><br>
><br>
> On Thu, Aug 1, 2013 at 1:53 PM, Noel Scudder <<a href="mailto:noel.scudder@stonybrook.edu">noel.scudder@stonybrook.edu</a>>wrote:<br>
><br>
>> Hi all,<br>
>><br>
>> Over the past few days I've been investigating the<br>
>> MultiVariateTransferFunction and receiving feedback from Matt. Since it<br>
>> needs some updating and the documentation is so vague, I thought I'd try to<br>
>> outline the basic flow and idea of an MVTF (thanks to Matt for his<br>
>> outline), address a couple problems that have been noticed, and give an<br>
>> example script with images. Please feel free to correct my mistakes, ask<br>
>> questions, and add your own knowledge!<br>
>><br>
>> The code for the MVTF is<br>
>> in yt/visualization/volume_rendering/transfer_functions.py . It's also<br>
>> useful to check out the Planck and Color Transfer Functions in the same<br>
>> file.<br>
>><br>
>> With a CTF, you are limited to one field, which is linked identically to<br>
>> each of the RGB color channels and an alpha channel. However, an MVTF<br>
>> allows you to set up different fields that control each channel and each<br>
>> channel's opacity through the use of standard Transfer Functions. For<br>
>> instance, I could link the red color channel and the red alpha channel to<br>
>> Density, the blue and blue alpha channels to Temperature, and the green and<br>
>> green alpha channels to Kinetic Energy.<br>
>> It is important to note that only *one* field (and associated transfer<br>
>> function) may be linked to any channel. This limits the number of variables<br>
>> one can conceivably include to three.<br>
>><br>
>> When an MVTF is created, it sets up a few variables:<br>
>><br>
>> n_field_tables<br>
>> tables<br>
>> field_ids<br>
>> weight_field_ids<br>
>> field_table_ids<br>
>> weight_table_ids<br>
>> grad_field<br>
>> light_source_v<br>
>><br>
>> The important ones here are tables, field_ids, weight_field_ids,<br>
>> field_table_ids, and weight_table_ids.<br>
>> After creating your MVTF, the first thing you must do is create a<br>
>> TransferFunction, which has some range and number of bins. This can then be<br>
>> added as a "table" to your MVTF using add_field_table, which accepts the<br>
>> table, the field_id used for interpolating on the x-axis of this table, a<br>
>> weight_field_id, and/or a weight_table id.<br>
>> The field_id is *not* the field index you get from pf.h.field_indexes .<br>
>> Here, the field_id actually specifies the index of a certain field in the<br>
>> field list you supply to the camera object. For instance, if I gave the<br>
>> camera<br>
>><br>
>> fields=['density', 'Temp']<br>
>><br>
>> I would have previously called add_field_table using a field_id of 0 for<br>
>> the TransferFunctions I wanted for density, and using a field_id of 1 for<br>
>> the TransferFunctions I wanted for temperature.<br>
>> The same specification with the field_id goes for weight_field_id, which<br>
>> is used if the field itself should be a weighting factor for the<br>
>> emission/absorption (although this does not do scaling, so you will likely<br>
>> need to supply a pre-scaled field).<br>
>> By supplying a weight_table_id, you are taking the results of<br>
>> interpolation along the x-axis to get a y value from *another* field table<br>
>> and using that as a weight.<br>
>><br>
>> *Apparently density is typically logged by default. If you want to use it<br>
>> as a weight, you probably want it un-logged.<br>
>><br>
>> At this point you have added all of your field tables. The second step is<br>
>> to link the field tables to the channels you want. Right now, all you have<br>
>> is a set of "tables," TransferFunctions that describe how to get a value<br>
>> out as a combination of:<br>
>><br>
>> 1) The y-value interpolated along the x-axis defined by the table<br>
>> 2) The weighting from a given field<br>
>> 3) The weighting from a given field_table (i.e., if you had some scaling<br>
>> that was a function of temperature)<br>
>><br>
>> On its own, a table will do nothing--you must link it to a channel. These<br>
>> are, in order, RGB and aR, aG, aB. You use the link_channels function for<br>
>> this purpose, for instance linking table 0 to channel 0 (R). When linking<br>
>> channels, there are a couple things to keep in mind. The two arguments you<br>
>> supply are the table_id and the channel, both *integers *(seems like a<br>
>> common theme for MVTF stuff :-) ). The channel can be integers 0-5,<br>
>> assigned in the order above. The table_id is a bit more nebulous: a<br>
>> table_id is assigned to a table when it is created, meaning that the first<br>
>> table you create using add_field_table will have a table_id of 0, the next<br>
>> will have a table_id of 1, and so on. Although you cannot link more than<br>
>> one table to a channel, you can have more than one channel linked to a<br>
>> single table--simply supply a list in place of an integer for the channel<br>
>> argument.<br>
>><br>
>> Finally, don't leave your TransferFunctions empty! Add some gaussians,<br>
>> keeping in mind the channel and field each TF uses. After that your MVTF<br>
>> will be ready, and you can supply it to the camera object like any other<br>
>> transfer function and take a snapshot.<br>
>><br>
>> Here's a example script: <a href="http://pastebin.com/NC4pHPR7" target="_blank">http://pastebin.com/NC4pHPR7</a><br>
>><br>
>> Which creates this image: <a href="http://i.imgur.com/EKv943G.png" target="_blank">http://i.imgur.com/EKv943G.png</a><br>
>><br>
>> The main problem I've been noticing is with the grey_opacity, which was<br>
>> already discussed--apparently the MVTF was never updated after opaque<br>
>> volume rendering was implemented. Although by default an MVTF doesn't have<br>
>> a grey_opacity attribute and yt will complain about this, you can placate<br>
>> the beast by supplying<br>
>><br>
>> mv.grey_opacity=False<br>
>><br>
>> anyway. If you set grey_opacity to True, however, odd things will happen,<br>
>> which I suspect is simply due to the MVTF not having been updated for<br>
>> opaque rendering yet: <a href="http://i.imgur.com/rrOnbgy.png" target="_blank">http://i.imgur.com/rrOnbgy.png</a><br>
>> I think that about sums up my two cents on the MVTF.<br>
>><br>
>><br>
>> Finally, my original desire was to have two different<br>
>> ColorTransferFunctions with two different fields rendered by one camera at<br>
>> once. In other words, simultaneously render two different colormaps applied<br>
>> to two different fields. Right now this isn't possible in yt (although Matt<br>
>> thinks it may be somewhat straightforward to implement), so I came up with<br>
>> a makeshift way, where I render one TF for the first field without a<br>
>> background and the second TF for the second field *with* a background,<br>
>> and then overlay them using ImageMagick:<br>
>><br>
>> im.write_png('transparent_temp.png', background=None)<br>
>> ...<br>
>> im2.write_png('dens_and_background.png')<br>
>> os.system('composite transparent_temp.png dens_and_background.png<br>
>> multi.png')<br>
>><br>
>> However, it's expensive, and it goes outside yt. Does anyone know if<br>
>> there's a way to combine these images without leaving yt?<br>
>><br>
>> Thanks for reading!<br>
>><br>
>> -Noel<br>
>><br>
>><br>
>> On Tue, Jul 30, 2013 at 1:03 PM, Sam Skillman <<a href="mailto:samskillman@gmail.com">samskillman@gmail.com</a>>wrote:<br>
>><br>
>>> Hi all,<br>
>>> The multivariate tf could use both some updating and documentation. I'm<br>
>>> offline for the next few days but if it hasn't been fixed by next week I<br>
>>> can take a look.<br>
>>><br>
>>> Sam<br>
>>> On Jul 30, 2013 8:40 AM, "Nathan Goldbaum" <<a href="mailto:nathan12343@gmail.com">nathan12343@gmail.com</a>><br>
>>> wrote:<br>
>>><br>
>>>> Hi Noel,<br>
>>>><br>
>>>> I believe this is a bug that needs to be fixed. It seems<br>
>>>> MultiVariateTransferFunction was never updated after opaque volume<br>
>>>> rendering was added.<br>
>>>><br>
>>>> Can you please open a new issue about this?<br>
>>>><br>
>>>> Nathan<br>
>>>><br>
>>>> On Tuesday, July 30, 2013, Noel Scudder wrote:<br>
>>>><br>
>>>>> Hi all,<br>
>>>>><br>
>>>>> I'm attempting to visualize multiple variables in the same volume<br>
>>>>> rendering. For instance, I'd like to show some density surfaces of a star<br>
>>>>> and then get temperature overlayed to show hotspots. I found the<br>
>>>>> MultiVariateTransferFunction, but it is unfortunately not particularly well<br>
>>>>> documented yet, and I'm being repeatedly thwarted. I'm not sure if I've set<br>
>>>>> it up correctly, or how to go from the transfer function to an image.<br>
>>>>> Here's my current script, using just one variable for now:<br>
>>>>><br>
>>>>> #----------------------------------<br>
>>>>> from yt.mods import *<br>
>>>>> pf = load('plt00100')<br>
>>>>><br>
>>>>> #<some constants><br>
>>>>><br>
>>>>> pf.h<br>
>>>>> pf.field_info['density'].take_log=True<br>
>>>>><br>
>>>>> mv = MultiVariateTransferFunction()<br>
>>>>><br>
>>>>> tf = TransferFunction((mi-1, ma+1), nbins=1.0e6)<br>
>>>>> tf.add_gaussian(np.log10(9.0e5), 0.01, 1.0)<br>
>>>>><br>
>>>>> mv.add_field_table(tf, 0)<br>
>>>>> mv.link_channels(0, [0,1,2,3])<br>
>>>>><br>
>>>>> c = [5.0e9, 5.0e9, 5.0e9]<br>
>>>>> L = [0.15, 1.0, 0.40]<br>
>>>>> W = wi*0.7<br>
>>>>> Nvec = 1024<br>
>>>>><br>
>>>>> cam = pf.h.camera(c, L, W, (Nvec,Nvec), transfer_function = mv,<br>
>>>>> fields=['density'], pf=pf, no_ghost=True)<br>
>>>>><br>
>>>>> im = cam.snapshot(num_threads=4)<br>
>>>>><br>
>>>>> im.write_png('plt00100.png' )<br>
>>>>> #----------------------------------<br>
>>>>><br>
>>>>> I checked to make sure density is indeed my 0-index field. I get the<br>
>>>>> following error after ray casting:<br>
>>>>><br>
>>>>> Traceback (most recent call last):<br>
>>>>> File "<stdin>", line 1, in <module><br>
>>>>> File "multivol.py", line 153, in <module><br>
>>>>> im = cam.snapshot(num_threads=4)<br>
>>>>> File<br>
>>>>> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",<br>
>>>>> line 742, in snapshot<br>
>>>>> image, sampler),<br>
>>>>> File<br>
>>>>> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",<br>
>>>>> line 632, in _render<br>
>>>>> image = self.finalize_image(image)<br>
>>>>> File<br>
>>>>> "/home/noel/shocks/yt-x86_64/src/yt-hg/yt/visualization/volume_rendering/camera.py",<br>
>>>>> line 611, in finalize_image<br>
>>>>> if self.transfer_function.grey_opacity is False:<br>
>>>>> AttributeError: 'MultiVariateTransferFunction' object has no attribute<br>
>>>>> 'grey_opacity'<br>
>>>>><br>
>>>>><br>
>>>>> Can I not use snapshot in this case, or is something else the matter<br>
>>>>> entirely?<br>
>>>>><br>
>>>>> Thanks,<br>
>>>>> Noel Scudder<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>
>> _______________________________________________<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>
> _______________________________________________<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>
<br>
--<br>
Cameron Hummels<br>
Postdoctoral Researcher<br>
Steward Observatory<br>
University of Arizona<br>
<a href="http://chummels.org" target="_blank">http://chummels.org</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/3eb8ad04/attachment.htm" target="_blank">http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130801/3eb8ad04/attachment.htm</a>><br>
<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>
End of yt-users Digest, Vol 66, Issue 3<br>
***************************************<br>
</blockquote></div><br></div></div>