[yt-users] Strange Behaviour in ProjectionPlot

Britton Smith brittonsmith at gmail.com
Mon Nov 12 10:25:46 PST 2012


Hi Patrick,

Is this a cosmology simulation?  If so, I think the issue is that the
window is in physical coordinates, which are increasing with time.

Britton


On Mon, Nov 12, 2012 at 1:21 PM, Nathan Goldbaum <nathan12343 at gmail.com>wrote:

> Hi Patrick,
>
> I'm unable to reproduce the issue you're seeing.  I'm running the
> following script:
>
> from yt.mods import * # set up our namespace
> from yt.analysis_modules.level_**sets.api import *
>
> pf = load("galaxy0030/galaxy0030")
>
> master_clump = pf.h.load_object('My_Clumps')
>
> all_clumps = get_lowest_clumps(master_**clump)
>
> for i in range(1,3):
>
>     prj = ProjectionPlot(pf,2,'Density',**center='c')
>
>     prj.set_width((20,'kpc'))
>
>     slc.annotate_text([0.0,1.05], "Clump %s" % i)
>
>     slc.annotate_clumps([all_**clumps[i]])
>
>     slc.save(str(i))
>
> I've previously saved the clump objects in the file "My_clumps".  I did
> this following Britton's recipe from the workshop:
>
> https://bitbucket.org/**brittonsmith/yt.workshop2012.**clump-finding/src/*
> *1e7af99cec95fb307bb79055f908d3**9a200b7091/scripts/find_**
> clumps_and_save.py?at=default<https://bitbucket.org/brittonsmith/yt.workshop2012.clump-finding/src/1e7af99cec95fb307bb79055f908d39a200b7091/scripts/find_clumps_and_save.py?at=default>
>
> When I run the script, I get the following two images:
>
> http://i.imgur.com/MhkaQ.png
> http://i.imgur.com/ZGzTl.png
>
> This script uses the IsolatedGalaxy dataset stored at yt-project.org/data
>
> It would help me track down what's going wrong if you could come up with a
> somewhat simpler script that reproduces the error, preferably using one of
> the datasets on yt-project.org.  Please feel free to e-mail me in private
> or join us on irc so we can iterate on this.
>
> Cheers,
>
> Nathan
>
>
> On 11/12/12 9:50 AM, Patrick Rieser wrote:
>
>> Hey all,
>>
>> So I still get some strange behaviour with the ProjectionPlot. If I use
>> the projection.set_width() with the clumps callback method I get the real
>> image shrinked inside the the plot window. Strange thing is, that it grows
>> with each step! Here is a demonstration how it looks (you have to look
>> closely as it doesn't grow that much each step):
>>
>> http://www.flickr.com/photos/**87912862@N05/sets/**72157631990474435/<http://www.flickr.com/photos/87912862@N05/sets/72157631990474435/>
>>
>> If I don't use the set_width() then the image itself looks fine, but the
>> scale on the axis grows with each step. So it seems to be the same error
>> than with fixed width.
>>
>>
>> Best wishes,
>> Patrick
>>
>>
>>
>> Here is the code that I am using:
>>
>> # ID is just a list of tuples with clumps/their position in an array
>> # sim_files and clump_files is a list containing the filenames
>> # get_myclump() simply returns a specific clump
>>
>> for j, series in enumerate(ID):
>>     for i in series:
>>         pf = load(sim_files[i[0]])
>>         myclump = get_myclump(clump_files[i[0]], i[1])
>>
>>         pc = ProjectionPlot(pf, axis, my_field, center =
>> pf.domain_center, weight_field = my_wfield)
>>         pc.set_width(28, "mpc")
>>         pc.annotate_text([0.0,1.05], "Clump %s" % j)
>>
>>         if redshift:
>>             pc.annotate_text([0.917,1.05], "z = %0.4f" %
>> pf.current_redshift)
>>         if grid:
>>             pc.annotate_grids()
>>         if fix_scale:
>>             pc.set_zlim(my_field,**boundaries[0],boundaries[1])
>>
>>         pc.set_cmap("Density", "idl01")
>>         pc.annotate_clumps(myclump)
>>
>>         pc.save('%s/Clump_%s_File_%s_**Nr_%s_%s_Projection.png' %
>> (myBASEDIR, j, i[0], i[1], axis))
>> ______________________________**_________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/**listinfo.cgi/yt-users-**spacepope.org<http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
>>
>
> ______________________________**_________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/**listinfo.cgi/yt-users-**spacepope.org<http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20121112/9cfaf8a9/attachment.htm>


More information about the yt-users mailing list