<div dir="ltr">Hello,<div><br></div><div style>I have 2 problems, but possibly I only need the solution to one :)</div><div style><br></div><div style>(1) If I calculate the total mass in a simulation via the projection:</div>
<div style><br></div><div style>projection = pf.h.proj(2, 'CellMass')<br></div><div style>sum(projection["CellMass"]/projection["pdx"]/2.0/3.08568025e18)<br></div><div style><br></div><div style>
(i.e. sum(sum(m_i*dl)/dl) )</div><div style><br></div><div style>I get:  1.4855032022312827e+43</div><div><br></div><div style>However, if I just sum it directly:</div><div style><br></div><div style>dd = pf.h.all_data()</div>
<div style>sum(dd["CellMass"])<br></div><div style><br></div><div style>I get: 6.3279045575257765e+42</div><div style><br></div><div style>I was expecting those two numbers to be approximately the same. Why are they very different? Have I misunderstood the value of pdx? I think it should be equal to half the integration step.</div>
<div style><br></div><div style>(2) The second problem occurred when I tried to fix this by using a fixed resolution projection (in case a variable dl was the issue).</div><div style><br></div><div style>I tried:</div><div style>
<br></div><div style>proj = pf.h.fixed_res_proj(2, 0, [0, 0, 0], [128,128,128])<br></div><div style><br></div><div style>(My root grid is 128^3)</div><div style><br></div><div style>but I get:</div><div style><br></div><div style>
<div>ValueError                                Traceback (most recent call last)</div><div>/home/tasker/yt-new/src/yt-hg/scripts/iyt in <module>()</div><div>----> 1 proj = pf.h.fixed_res_proj(2, 0, [0, 0, 0], [128,128,128])</div>
<div><br></div><div>/home/tasker/yt-new/src/yt-hg/yt/data_objects/data_containers.pyc in __init__(self, axis, level, left_edge, dims, fields, pf, **kwargs)</div><div>   2460         self.domain_width = np.rint((self.pf.domain_right_edge -</div>
<div>   2461                     self.pf.domain_left_edge)/self.dds).astype('int64')</div><div>-> 2462         self._refresh_data()</div><div>   2463 </div><div>   2464     def _get_list_of_grids(self):</div><div>
<br></div><div>/home/tasker/yt-new/src/yt-hg/yt/data_objects/data_containers.pyc in _refresh_data(self)</div><div>    318         """</div><div>    319         self.clear_data()</div><div>--> 320         self.get_data()</div>
<div>    321 </div><div>    322     def keys(self):</div><div><br></div><div>/home/tasker/yt-new/src/yt-hg/yt/data_objects/data_containers.pyc in get_data(self, fields)</div><div>   2494         Iterates over the list of fields and generates/reads them all.</div>
<div>   2495         """</div><div>-> 2496         self._get_list_of_grids()</div><div>   2497         if not self.has_key('pdx'):</div><div>   2498             self._generate_coords()</div><div>
<br></div><div>/home/tasker/yt-new/src/yt-hg/yt/data_objects/data_containers.pyc in _get_list_of_grids(self)</div><div>   2470         else:</div><div>   2471             grids,ind = self.pf.hierarchy.get_box_grids(</div>
<div>-> 2472                             self.left_edge, self.right_edge)</div><div>   2473         level_ind = (self.pf.hierarchy.grid_levels.ravel()[ind] <= self.level)</div><div>   2474         sort_ind = np.argsort(self.pf.h.grid_levels.ravel()[ind][level_ind])</div>
<div><br></div><div>/home/tasker/yt-new/src/yt-hg/yt/data_objects/object_finding_mixin.pyc in get_box_grids(self, left_edge, right_edge)</div><div>    201         eps = np.finfo(np.float64).eps</div><div>    202         grid_i = np.where((np.all((self.grid_right_edge - left_edge) > eps, axis=1)</div>
<div>--> 203                          & np.all((right_edge - self.grid_left_edge) > eps, axis=1)) == True)</div><div>    204 </div><div>    205         return self.grids[grid_i], grid_i</div><div><br></div><div>
ValueError: operands could not be broadcast together with shapes (3,3) (7100,3) </div><div><br></div><div><br></div><div style>What did I do wrong?</div><div style><br></div><div style>Thank you!</div><div style><br></div>
<div style>Elizabeth</div></div></div>