<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 17, 2016 at 5:47 PM, bh11e <span dir="ltr"><<a href="mailto:bh11e@my.fsu.edu" target="_blank">bh11e@my.fsu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi,<br>
<br>
I'm creating 1D profiles with as much bins as the top grid zones along the same axis:<br>
<br>
ProfilePlot( ds.all_data(), 'z', field_name, weight_field=weight_field_name,<br>
                      x_log=False, y_log={field_name:False},<br>
                      n_bins=ds.domain_dimensions[2] )<br>
<br>
i.e. each bin should include a 1-zone thick slice of the top grid. All profiles created this way end up with the first and the last bins equal to zero. Am I not doing something wrong? Or is it because the bins' boundaries are created to be centered on the grid zones, This way the end grid zones fall on a bin boundary and are being filtered by the following lines :<br>
<br>
profiles.py:<br>
class ProfileND:<br>
    ...<br>
    def _filter(self, bin_fields):<br>
        ...<br>
        for (mi, ma), data in zip(self.bounds, bin_fields):<br>
            filter &= (data > mi)<br>
            filter &= (data < ma)<br>
...<br>
<br>
The rightmost zone seems to be filtered out a second time by the np.digitize call in the following code:<br>
<br>
profiles.py:<br>
class Profile1D:<br>
    ....<br>
    def _bin_chunk(self, chunk, fields, storage):<br>
        ...<br>
        bin_ind = np.digitize(bf_x, self.x_bins) - 1<br>
...<br>
<br>
Above the 'right' argument to digitize is not being set and defaults to False (see: <a href="http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.digitize.html" rel="noreferrer" target="_blank">http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.digitize.html</a>)<br>
<br>
My solution was to modify the "mi" and "ma" values (in the first code snippet) to match the grid left and right edges but that of course is a workaround only for this particular case. Any thoughts?<br>
<br>
Thanks,<br>
--Boyan Hristov<br></blockquote><div><br></div><div>Hi Boyan,</div><div><br></div><div>Thanks for tracking down in the yt codebase where this is happening. Would you be interested in submitting a pull request to fix this issue? I'd be happy to share more information about contributing, but you can also look at the developer guide:</div><div><br></div><div><a href="http://yt-project.org/docs/dev/developing/developing.html#how-to-develop-yt">http://yt-project.org/docs/dev/developing/developing.html#how-to-develop-yt</a><br></div><div><br></div><div>While this is probably a behavior change, I think it might be a worthwhile one. Submitting a pull request will at least allow us to see what tests fail (if any) and evaluate the potential impact.</div><div><br></div><div>-Nathan</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div></div>