[yt-svn] commit/yt: ngoldbaum: Minor fixes for load_particles
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Tue Jan 10 06:56:46 PST 2017
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/commits/ed2b7fa425ca/
Changeset: ed2b7fa425ca
Branch: yt
User: ngoldbaum
Date: 2017-01-09 22:02:31+00:00
Summary: Minor fixes for load_particles
Affected #: 1 file
diff -r 462126c6d9aefcbb363814d3a406df4fa5ebe959 -r ed2b7fa425ca7aeaf6f4b9174e2787b342ad2ce5 yt/frontends/stream/data_structures.py
--- a/yt/frontends/stream/data_structures.py
+++ b/yt/frontends/stream/data_structures.py
@@ -1036,10 +1036,9 @@
This should allow a collection of particle data to be loaded directly into
yt and analyzed as would any others. This comes with several caveats:
- * Units will be incorrect unless the data has already been converted to
- cgs.
- * Some functions may behave oddly, and parallelism will be
- disappointing or non-existent in most cases.
+ * There must be sufficient space in memory to contain both the particle
+ data and the octree used to index the particles.
+ * Parallelism will be disappointing or non-existent in most cases.
This will initialize an Octree of data. Note that fluid fields will not
work yet, or possibly ever.
@@ -1047,9 +1046,9 @@
Parameters
----------
data : dict
- This is a dict of numpy arrays, where the keys are the field names.
- Particles positions must be named "particle_position_x",
- "particle_position_y", "particle_position_z".
+ This is a dict of numpy arrays or (numpy array, unit name) tuples,
+ where the keys are the field names. Particles positions must be named
+ "particle_position_x", "particle_position_y", and "particle_position_z".
length_unit : float
Conversion factor from simulation length units to centimeters
mass_unit : float
@@ -1087,6 +1086,8 @@
nprocs = 1
if bbox is None:
bbox = np.array([[0.0, 1.0], [0.0, 1.0], [0.0, 1.0]], 'float64')
+ else:
+ bbox = np.array(bbox)
domain_left_edge = np.array(bbox[:, 0], 'float64')
domain_right_edge = np.array(bbox[:, 1], 'float64')
grid_levels = np.zeros(nprocs, dtype='int32').reshape((nprocs,1))
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