<div dir="ltr">Hi Nathan,<div><br></div><div>Thanks for your reply! Please let me interact with Britton to make sure if it's not my error. Then I'll open an issue.</div><div><br></div><div>Thanks,</div><div>Pengfei</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 7:06 AM, Nathan Goldbaum <span dir="ltr"><<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Pengfei,<div><br></div><div>Can you <span></span>open an issue so we don't lose track of this?</div><div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/issues/new" target="_blank">https://bitbucket.org/yt_<wbr>analysis/yt/issues/new</a><br></div><div><br></div><div>If you can, include a self-contained example using one of the cosmology time series datasets from <a href="http://yt-project.org/data" target="_blank">yt-project.org/data</a> so one of us can reproduce you issue locally.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Nathan</div></font></span><div class="HOEnZb"><div class="h5"><div><br>On Monday, August 8, 2016, Pengfei Chen <<a href="mailto:madcpf@gmail.com" target="_blank">madcpf@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I was trying to generate light rays using yt 3.4-dev, but found that the light rays have wrong redshift intervals. For example, my simulation box is 80Mpccm/h per side, and I expect a light ray generated in a data dump at z=2 with length =1 simulation unit (i.e. 80Mpccm/h) would have a redshift interval from z=2 to z=1.92. However, the light ray generated by yt gives spans from z=2 to z=1.97.</div><div><br></div><div>As I look into this, I found that the function comoving_radial_distance in cosmology.py might return the wrong unit. I think the return value should be in comoving units, instead of physical units. To see this directly, I made the following change in cosmology_splice.py:</div><div><br></div><div><div>(root) ~/yt-conda/src/yt-hg/yt/analys<wbr>is_modules/cosmological_observ<wbr>ation $diff cosmology_splice.py cosmology_splice.py0</div><div>373d372<br></div><div><             print target_distance, distance2, z2</div></div><div><br></div><div>And it shows:</div><div><br></div><div><div>80.0 Mpccm/h 4.65320708035e+26 cm 1.97387969592 dimensionless</div><div>80.0 Mpccm/h 1.19455177073e+26 cm 1.97343368065 dimensionless</div><div>80.0 Mpccm/h 1.21507519065e+26 cm 1.97342592996 dimensionless</div></div><div><br></div><div><div>Then I made the following change in cosmology.py:</div><div><br></div><div><div>(root) ~/yt-conda/src/yt-hg/yt/utilit<wbr>ies $diff cosmology.py cosmology.py0</div><div>111,112c111,112</div><div><         return self.quan((self.hubble_distanc<wbr>e() *</div><div><                 trapzint(self.inverse_expansio<wbr>n_factor, z_i, z_f)).value, 'cmcm')</div><div>---</div><div>>         return (self.hubble_distance() *</div><div>>                 trapzint(self.inverse_expansio<wbr>n_factor, z_i, z_f)).in_base(self.unit_system<wbr>)</div></div></div><div><br></div><div><br></div><div>Then I get:</div><div><div>80.0 Mpccm/h 4.65320708035e+26 cmcm 1.92163908776 dimensionless</div><div>80.0 Mpccm/h 3.62771515661e+26 cmcm 1.92124702027 dimensionless</div></div><div><br></div><div>With the change of unit from cm to cmcm, the light rays have the right span.</div><div><br></div><div>Even though this solves my problem, I am not sure if similar problem still exists. For example, instead of making change in comoving_radial_distance, we might need to change hubble_distance into comoving units. Hopefully someone familiar with yt unit system could check this.</div><div><br></div><div>Thanks,<br>Pengfei</div>































</div>
</blockquote></div>
</div></div><br>______________________________<wbr>_________________<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/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div>