Hi Nathan,

Thanks for the response!  The problem still shows up when I zoom in on the png, although I am wondering if there are so many clumps that need to be annotated in a single pixel that it is just freaking out?  I am trying with a smaller side-length to see if it makes a difference (although this has instigated my other question about set_buff_size in a different email).  

I will take a look at what you suggested, but I think I may have a fundamental misunderstanding of what I am asking yt to do for me.  My clumps are little clouds that get more dense towards the center, so don't really look like the cookbook example (stretched out overdensities to my eye).  I thought that because in my script I have:

> leaf_clumps = get_lowest_clumps(master_clump)

then leaf_clumps are my "ends" that don't have anything lower?  

Yet when I type 

> prj.annotate_clumps(leaf_clumps)

yt seems to be trying to annotate a *lot* of clumps!  As evidenced by the figure I attached before and the .o file which has a list that ends at "Pixelizing contour 391".  

BUT, when I type 
> print (leaf_clumps[0]["gas","density"])

I get 22 outputs.  

Do I need to annotate_clumps(leaf_clumps[0])?  If so then leaf_clumps wouldn't actually be the "get_lowest_clumps"....

Not sure what is going on...

Thanks again,
Stephanie

--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY

stonnes@gmail.com


On Tue, Aug 28, 2018 at 10:43 PM Nathan Goldbaum <nathan12343@gmail.com> wrote:
Hi Stephanie,

No idea what's happening here. Does it still look weird when you zoom in?

If I were in your shoes right now, I'd look very carefully right here after this for loop:

https://github.com/yt-project/yt/blob/master/yt/visualization/plot_modifications.py#L1034

In particular, I'd probably make an imshow plot of the "buff" array. I'd also put a breakpoint inside the for loop look carefully at the data being passed to the pixelize_cartesian function, which is accepting the x, dx, y, and dy fields for the each clump (e.g. the x, and y positions of all the zones in each clump as well as the cell spacing in x and y for the same zones), along with an integer mask.

-Nathan

On Tue, Aug 28, 2018 at 10:20 PM Stephanie Tonnesen <stonnes@gmail.com> wrote:
Dear yt-users,

I am having some trouble with the yt clump finder. Mostly, my issue is that I don't understand what I am getting when I annotate the projectionplot.  Instead of the nice lines in the example, I get strange filled-in circles?

My figure is attached, and here is my code:

##################
ds = yt.load("/mnt/ceph/users/stonnesen/runs/JO204wind/DD"+loop[i]+"/JO204cw"+loop[i])

    ad = ds.all_data()
    data_source = ad.cut_region(["obj['z'] > 0.27"]) #ds.disk([0.5, 0.5, 0.5], [0., 0., 1.],(80, 'kpc'), (145, 'kpc'))

    # the field to be used for contouring
    field = ("gas", "density")

    # This is the multiplicative interval between contours.
    step = 2.0

    # Now we set some sane min/max values between which we want to find contours
    # This is how we tell the clump finder what to look for -- it won't look for
    # contours connected below or above these threshold values.
    c_min = 2e-25 #10**np.floor(np.log10(data_source[field]).min()+3 )
    c_max = 10**np.floor(np.log10(data_source[field]).max()+1)

    # Now find get our 'base' clump -- this one just covers the whole domain.
    master_clump = Clump(data_source, 'density')

    # Add a "validator" to weed out clumps with less than 16 cells.
    # As many validators can be added as you want.
    master_clump.add_validator("min_cells", 16)
    
    # Calculate center of mass for all clumps.
    master_clump.add_info_item("center_of_mass")

    # Begin clump finding.
    find_clumps(master_clump, c_min, c_max, step)

    # Save the clump tree as a reloadable dataset
    fn = master_clump.save_as_dataset(fields=["density"])

    # Traverse the clump hierarchy to get a list of all of the 'leaf' clumps
    leaf_clumps = get_lowest_clumps(master_clump)

    # To visualize these clumps, a list of clumps can be supplied to
    # the "clumps" callback on a plot.  First, we create a projection plot:
    prj = yt.ProjectionPlot(ds, 0, 'density', center=[0.5,0.5,0.5],width=(160,'kpc'))
    prj.set_buff_size(4000)
    # Next we annotate the plot with contours on the borders of the clumps
    prj.annotate_clumps(leaf_clumps)
    
    # Save the plot to disk.
    prj.save('JO204cw'+loop[i]+'_clumps_16pix')

##########################

Also, when I have 

> print (leaf_clumps[0]["gas","density"])

I get 22 outputs, which seems like a lot less than what is getting put on the figure?

Anyway, I am lost and any help would be greatly appreciated.

Best,
Stephanie



--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY

stonnes@gmail.com
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org