[Yt-svn] commit/yt: 2 new changesets
Bitbucket
commits-noreply at bitbucket.org
Tue Jun 7 13:51:35 PDT 2011
2 new changesets in yt:
http://bitbucket.org/yt_analysis/yt/changeset/d2f6a5f78a07/
changeset: d2f6a5f78a07
branch: yt
user: Cameron Hummels
date: 2011-06-07 22:51:19
summary: Fixed bug with docstrings and quotes for camera object.
affected #: 1 file (0 bytes)
--- a/yt/visualization/volume_rendering/camera.py Tue Jun 07 15:02:53 2011 -0400
+++ b/yt/visualization/volume_rendering/camera.py Tue Jun 07 16:51:19 2011 -0400
@@ -497,7 +497,7 @@
--------
>>> for i, snapshot in enumerate(cam.rotation(na.pi, 10)):
- ... iw.write_bitmap(snapshot, "rotation_%04i.png" % i)
+ ... iw.write_bitmap(snapshot, 'rotation_%04i.png' % i)
"""
dtheta = (1.0*theta)/n_steps
http://bitbucket.org/yt_analysis/yt/changeset/18f0d2c01fc7/
changeset: 18f0d2c01fc7
branch: yt
user: Cameron Hummels
date: 2011-06-07 22:51:32
summary: Merging.
affected #: 2 files (108 bytes)
--- a/yt/analysis_modules/light_ray/light_ray.py Tue Jun 07 16:51:19 2011 -0400
+++ b/yt/analysis_modules/light_ray/light_ray.py Tue Jun 07 16:51:32 2011 -0400
@@ -164,7 +164,8 @@
def make_light_ray(self, seed=None, fields=None,
solution_filename=None, data_filename=None,
- get_nearest_galaxy=False, get_los_velocity=False, **kwargs):
+ get_nearest_galaxy=False, get_los_velocity=False,
+ halo_mass_field='TotalMassMsun_200', **kwargs):
"""
Create a light ray and get field values for each lixel. A light ray consists of
a list of field values for cells intersected by the ray and the path length of
@@ -296,7 +297,8 @@
# Calculate distance to nearest object on halo list for each lixel.
if get_nearest_galaxy:
sub_data['nearest_galaxy'], sub_data['nearest_galaxy_mass'] = \
- self._get_nearest_galaxy_distance(sub_data, halo_list)
+ self._get_nearest_galaxy_distance(sub_data, halo_list,
+ halo_mass_field=halo_mass_field)
sub_data['nearest_galaxy'] *= pf.units['mpccm']
# Remove empty lixels.
@@ -351,8 +353,7 @@
return new_data
def _get_halo_list(self, dataset, halo_profiler_kwargs=None,
- halo_profiler_actions=None, halo_list='all',
- halo_mass_field='TotalMassMsun_200'):
+ halo_profiler_actions=None, halo_list='all'):
"Load a list of halos for the dataset."
if halo_profiler_kwargs is None: halo_profiler_kwargs = {}
--- a/yt/analysis_modules/simulation_handler/enzo_simulation.py Tue Jun 07 16:51:19 2011 -0400
+++ b/yt/analysis_modules/simulation_handler/enzo_simulation.py Tue Jun 07 16:51:32 2011 -0400
@@ -43,7 +43,7 @@
Super class for performing the same operation over all data dumps in
a simulation from one redshift to another.
"""
- def __init__(self, EnzoParameterFile, initial_time=None, final_time=None, initial_redshift=None, final_redshift=None,
+ def __init__(self, enzo_parameter_file, initial_time=None, final_time=None, initial_redshift=None, final_redshift=None,
links=False, enzo_parameters=None, get_time_outputs=True, get_redshift_outputs=True, get_available_data=False,
get_data_by_force=False):
"""
@@ -70,14 +70,14 @@
is loaded up to get the time and redshift manually. This is useful with collapse simulations that use
OutputFirstTimeAtLevel or with simulations that make outputs based on cycle numbers. Default: False.
"""
- self.EnzoParameterFile = EnzoParameterFile
+ self.enzo_parameter_file = enzo_parameter_file
self.enzoParameters = {}
self.redshift_outputs = []
self.allOutputs = []
self.InitialTime = initial_time
self.FinalTime = final_time
- self.InitialRedshift = initial_redshift
- self.FinalRedshift = final_redshift
+ self.initial_redshift = initial_redshift
+ self.final_redshift = final_redshift
self.links = links
self.get_time_outputs = get_time_outputs
self.get_redshift_outputs = get_redshift_outputs
@@ -202,20 +202,20 @@
"""
# Check for sufficient starting/ending parameters.
- if self.InitialTime is None and self.InitialRedshift is None:
+ if self.InitialTime is None and self.initial_redshift is None:
if self.enzoParameters['ComovingCoordinates'] and \
'CosmologyInitialRedshift' in self.enzoParameters:
- self.InitialRedshift = self.enzoParameters['CosmologyInitialRedshift']
+ self.initial_redshift = self.enzoParameters['CosmologyInitialRedshift']
elif 'InitialTime' in self.enzoParameters:
self.InitialTime = self.enzoParameters['InitialTime']
else:
mylog.error("Couldn't find parameter for initial time or redshift from parameter file.")
return None
- if self.FinalTime is None and self.FinalRedshift is None:
+ if self.FinalTime is None and self.final_redshift is None:
if self.enzoParameters['ComovingCoordinates'] and \
'CosmologyFinalRedshift' in self.enzoParameters:
- self.FinalRedshift = self.enzoParameters['CosmologyFinalRedshift']
+ self.final_redshift = self.enzoParameters['CosmologyFinalRedshift']
elif 'StopTime' in self.enzoParameters:
self.FinalTime = self.enzoParameters['StopTime']
else:
@@ -236,11 +236,11 @@
OmegaMatterNow = self.enzoParameters['CosmologyOmegaMatterNow'],
OmegaLambdaNow = self.enzoParameters['CosmologyOmegaLambdaNow'],
InitialRedshift = self.enzoParameters['CosmologyInitialRedshift'])
- if self.InitialRedshift is not None:
- self.InitialTime = self.enzo_cosmology.ComputeTimeFromRedshift(self.InitialRedshift) / \
+ if self.initial_redshift is not None:
+ self.InitialTime = self.enzo_cosmology.ComputeTimeFromRedshift(self.initial_redshift) / \
self.enzo_cosmology.TimeUnits
- if self.FinalRedshift is not None:
- self.FinalTime = self.enzo_cosmology.ComputeTimeFromRedshift(self.FinalRedshift) / \
+ if self.final_redshift is not None:
+ self.FinalTime = self.enzo_cosmology.ComputeTimeFromRedshift(self.final_redshift) / \
self.enzo_cosmology.TimeUnits
# Get initial time of simulation.
@@ -286,7 +286,7 @@
def _read_enzo_parameter_file(self):
"Reads an Enzo parameter file looking for cosmology and output parameters."
- lines = open(self.EnzoParameterFile).readlines()
+ lines = open(self.enzo_parameter_file).readlines()
for line in lines:
if line.find("#") >= 0: # Keep the commented lines
line=line[:line.find("#")]
@@ -383,8 +383,8 @@
the lowest redshift dataset present will be used. Default: None.
"""
- if initial_redshift is None: initial_redshift = self.InitialRedshift
- if final_redshift is None: final_redshift = self.FinalRedshift
+ if initial_redshift is None: initial_redshift = self.initial_redshift
+ if final_redshift is None: final_redshift = self.final_redshift
# Calculate maximum delta z for each data dump.
self._calculate_deltaz_max()
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