[Yt-svn] commit/yt: brittonsmith: halo_radius kwarg to HaloProfiler now overrides halo radii even if
Bitbucket
commits-noreply at bitbucket.org
Thu May 19 06:20:58 PDT 2011
1 new changeset in yt:
http://bitbucket.org/yt_analysis/yt/changeset/20f49aa1ac90/
changeset: r4272:20f49aa1ac90
branch: yt
user: brittonsmith
date: 2011-05-19 15:20:44
summary: halo_radius kwarg to HaloProfiler now overrides halo radii even if
the halo list includes a radius.
affected #: 1 file (276 bytes)
--- a/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Wed May 18 11:47:49 2011 -0400
+++ b/yt/analysis_modules/halo_profiler/multi_halo_profiler.py Thu May 19 09:20:44 2011 -0400
@@ -62,7 +62,7 @@
halo_finder_kwargs=dict(threshold=160.0, safety=1.5,
dm_only=False, resize=True,
fancy_padding=True, rearrange=True),
- halo_radius=0.1, radius_units='1', n_profile_bins=50,
+ halo_radius=None, radius_units='1', n_profile_bins=50,
recenter = None,
profile_output_dir='radial_profiles', projection_output_dir='projections',
projection_width=8.0, projection_width_units='mpc', project_at_level='max',
@@ -211,8 +211,12 @@
# Create dataset object.
self.pf = load(self.dataset)
self.pf.h
- if self.halos is 'single' or not 'r_max' in self.halo_list_format:
+ if self.halos is 'single' or \
+ not 'r_max' in self.halo_list_format or \
+ halo_radius is not None:
self.halo_radius = halo_radius / self.pf[radius_units]
+ else:
+ self.halo_radius = None
# Get halo(s).
if self.halos is 'single':
@@ -654,14 +658,17 @@
else:
halo[field] = __get_num(onLine[self.halo_list_format[field]])
if getID: halo['id'] = len(haloList)
- if has_rmax:
+ if self.halo_radius is not None:
+ halo['r_max'] = self.halo_radius * self.pf.units['mpc']
+ elif has_rmax:
halo['r_max'] *= self.pf.units['mpc']
elif has_r200kpc:
# If P-Groupfinder used, r_200 [kpc] is calculated.
# set r_max as 50% past r_200.
halo['r_max'] = 1.5 * halo['r200kpc'] / 1000.
else:
- halo['r_max'] = self.halo_radius * self.pf.units['mpc']
+ mylog.error("HaloProfiler has no way to get halo radius.")
+ return None
haloList.append(halo)
mylog.info("Loaded %d halos." % (len(haloList)))
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