[Yt-svn] commit/yt: brittonsmith: Fixed light ray tool for new naming convention of halo profiler
Bitbucket
commits-noreply at bitbucket.org
Tue Jun 7 08:45:26 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/bcab236019db/
changeset: bcab236019db
branches:
user: brittonsmith
date: 2011-06-07 17:44:59
summary: Fixed light ray tool for new naming convention of halo profiler
filtered quantities.
affected #: 1 file (262 bytes)
--- a/yt/analysis_modules/light_ray/light_ray.py Mon Jun 06 22:10:38 2011 -0400
+++ b/yt/analysis_modules/light_ray/light_ray.py Tue Jun 07 11:44:59 2011 -0400
@@ -184,7 +184,7 @@
GETTING THE NEAREST GALAXIES
The light ray tool will use the HaloProfiler to calculate the distance and mass
- of the nearest halo to that pixel. In order to do this, three additional keyword
+ of the nearest halo to that pixel. In order to do this, four additional keyword
arguments must be supplied to tell the HaloProfiler what to do.
:param halo_profiler_kwargs (dict): a dictionary of standard HaloProfiler keyword
@@ -211,6 +211,9 @@
:param halo_list (string): 'all' to use the full halo list, or 'filtered' to use
the filtered halo list created after calling make_profiles.
EXAMPLE: halo_list = 'filtered'
+
+ :param halo_mass_field (string): the field from the halo list to use for mass.
+ Default: 'TotalMassMsun_200'.
"""
# Calculate solution.
@@ -348,7 +351,8 @@
return new_data
def _get_halo_list(self, dataset, halo_profiler_kwargs=None,
- halo_profiler_actions=None, halo_list='all'):
+ halo_profiler_actions=None, halo_list='all',
+ halo_mass_field='TotalMassMsun_200'):
"Load a list of halos for the dataset."
if halo_profiler_kwargs is None: halo_profiler_kwargs = {}
@@ -371,7 +375,8 @@
del hp
return return_list
- def _get_nearest_galaxy_distance(self, data, halo_list):
+ def _get_nearest_galaxy_distance(self, data, halo_list,
+ halo_mass_field='TotalMassMsun_200'):
"""
Calculate distance to nearest object in halo list for each lixel in data.
Return list of distances and masses of nearest objects.
@@ -379,7 +384,7 @@
# Create position array from halo list.
halo_centers = na.array(map(lambda halo: halo['center'], halo_list))
- halo_mass = na.array(map(lambda halo: halo['TotalMassMsun'], halo_list))
+ halo_mass = na.array(map(lambda halo: halo[halo_mass_field], halo_list))
nearest_distance = na.zeros(data['x'].shape)
nearest_mass = na.zeros(data['x'].shape)
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