[yt-svn] commit/yt: 3 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jul 29 14:33:49 PDT 2014
3 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/d8db038701d7/
Changeset: d8db038701d7
Branch: yt-3.0
User: brittonsmith
Date: 2014-07-28 12:48:24
Summary: Ensuring correct incoming units of particle fields.
Affected #: 1 file
diff -r 63d5efd31fb4136046bf3dcc80c251a79943bc59 -r d8db038701d78753c3c4fc190aa475e8699ed146 yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
@@ -225,7 +225,11 @@
"particle_position_z",
"particle_velocity_x", "particle_velocity_y",
"particle_velocity_z"]:
- arr = chunk[rh.particle_type, field].astype("float64")
+ if "position" in field:
+ unit = "code_length"
+ else:
+ unit = "code_velocity"
+ arr = chunk[rh.particle_type, field].in_units(unit).astype("float64")
for i in range(npart):
p[0][i+pi].pos[fi] = (arr[i]-left_edge[fi])*conv[fi]
fi += 1
https://bitbucket.org/yt_analysis/yt/commits/c3ed647f5277/
Changeset: c3ed647f5277
Branch: yt-3.0
User: brittonsmith
Date: 2014-07-29 17:27:02
Summary: Simplifying unit conversion.
Affected #: 1 file
diff -r d8db038701d78753c3c4fc190aa475e8699ed146 -r c3ed647f5277397a12f4ef5f4f3226f24f64a4ec yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
@@ -172,7 +172,7 @@
cdef void rh_read_particles(char *filename, particle **p, np.int64_t *num_p):
global SCALE_NOW
- cdef np.float64_t conv[6], left_edge[6]
+ cdef np.float64_t left_edge[6]
cdef np.ndarray[np.int64_t, ndim=1] arri
cdef np.ndarray[np.float64_t, ndim=1] arr
cdef unsigned long long pi,fi,i
@@ -203,8 +203,6 @@
p[0] = <particle *> malloc(sizeof(particle) * local_parts)
- conv[0] = conv[1] = conv[2] = ds.length_unit.in_units("Mpccm/h")
- conv[3] = conv[4] = conv[5] = ds.velocity_unit.in_units("km/s")
left_edge[0] = ds.domain_left_edge[0]
left_edge[1] = ds.domain_left_edge[1]
left_edge[2] = ds.domain_left_edge[2]
@@ -226,12 +224,12 @@
"particle_velocity_x", "particle_velocity_y",
"particle_velocity_z"]:
if "position" in field:
- unit = "code_length"
+ unit = "Mpccm/h"
else:
- unit = "code_velocity"
+ unit = "km/s"
arr = chunk[rh.particle_type, field].in_units(unit).astype("float64")
for i in range(npart):
- p[0][i+pi].pos[fi] = (arr[i]-left_edge[fi])*conv[fi]
+ p[0][i+pi].pos[fi] = (arr[i]-left_edge[fi])
fi += 1
pi += npart
num_p[0] = local_parts
https://bitbucket.org/yt_analysis/yt/commits/7ad02474ac4f/
Changeset: 7ad02474ac4f
Branch: yt-3.0
User: samskillman
Date: 2014-07-29 23:33:42
Summary: Merged in brittonsmith/yt/yt-3.0 (pull request #1084)
Ensuring correct incoming units of particle fields for Rockstar (fixes Issue #869)
Affected #: 1 file
diff -r 6c919453204c25e586644eed8f04f1659760c471 -r 7ad02474ac4fc126369451eb6507d635e516c50f yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
--- a/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
+++ b/yt/analysis_modules/halo_finding/rockstar/rockstar_interface.pyx
@@ -172,7 +172,7 @@
cdef void rh_read_particles(char *filename, particle **p, np.int64_t *num_p):
global SCALE_NOW
- cdef np.float64_t conv[6], left_edge[6]
+ cdef np.float64_t left_edge[6]
cdef np.ndarray[np.int64_t, ndim=1] arri
cdef np.ndarray[np.float64_t, ndim=1] arr
cdef unsigned long long pi,fi,i
@@ -203,8 +203,6 @@
p[0] = <particle *> malloc(sizeof(particle) * local_parts)
- conv[0] = conv[1] = conv[2] = ds.length_unit.in_units("Mpccm/h")
- conv[3] = conv[4] = conv[5] = ds.velocity_unit.in_units("km/s")
left_edge[0] = ds.domain_left_edge[0]
left_edge[1] = ds.domain_left_edge[1]
left_edge[2] = ds.domain_left_edge[2]
@@ -225,9 +223,13 @@
"particle_position_z",
"particle_velocity_x", "particle_velocity_y",
"particle_velocity_z"]:
- arr = chunk[rh.particle_type, field].astype("float64")
+ if "position" in field:
+ unit = "Mpccm/h"
+ else:
+ unit = "km/s"
+ arr = chunk[rh.particle_type, field].in_units(unit).astype("float64")
for i in range(npart):
- p[0][i+pi].pos[fi] = (arr[i]-left_edge[fi])*conv[fi]
+ p[0][i+pi].pos[fi] = (arr[i]-left_edge[fi])
fi += 1
pi += npart
num_p[0] = local_parts
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list