[yt-svn] commit/yt-3.0: MatthewTurk: Fixing issue with yt-3.0 field detection for BetaPar.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Oct 11 06:57:40 PDT 2013
1 new commit in yt-3.0:
https://bitbucket.org/yt_analysis/yt-3.0/commits/5df0d5742ff2/
Changeset: 5df0d5742ff2
Branch: yt-3.0
User: MatthewTurk
Date: 2013-10-11 15:09:45
Summary: Fixing issue with yt-3.0 field detection for BetaPar.
Affected #: 2 files
diff -r e22fa4a3149a33c1b6caa79aaee0a68d358820d0 -r 5df0d5742ff2e8abcb6dd032f82247af9c6f0409 yt/analysis_modules/sunyaev_zeldovich/projection.py
--- a/yt/analysis_modules/sunyaev_zeldovich/projection.py
+++ b/yt/analysis_modules/sunyaev_zeldovich/projection.py
@@ -124,12 +124,16 @@
def _beta_par(field, data):
axis = data.get_field_parameter("axis")
+ # Load these, even though we will only use one
+ for ax in 'xyz':
+ data['%s-velocity' % ax]
vpar = data["Density"]*data["%s-velocity" % (vlist[axis])]
return vpar/clight
add_field("BetaPar", function=_beta_par)
+ self.pf.h._derived_fields_add(["BetaPar"])
proj = self.pf.h.proj("Density", axis, data_source=source)
- proj.set_field_parameter("axis", axis)
+ proj.data_source.set_field_parameter("axis", axis)
frb = proj.to_frb(width, nx)
dens = frb["Density"]
Te = frb["TeSZ"]/dens
@@ -195,6 +199,7 @@
data["z-velocity"]*L[2])
return vpar/clight
add_field("BetaPar", function=_beta_par)
+ self.pf.h._derived_fields_add(["BetaPar"])
dens = off_axis_projection(self.pf, ctr, L, w, nx, "Density")
Te = off_axis_projection(self.pf, ctr, L, w, nx, "TeSZ")/dens
diff -r e22fa4a3149a33c1b6caa79aaee0a68d358820d0 -r 5df0d5742ff2e8abcb6dd032f82247af9c6f0409 yt/data_objects/field_info_container.py
--- a/yt/data_objects/field_info_container.py
+++ b/yt/data_objects/field_info_container.py
@@ -330,6 +330,8 @@
self.requested_parameters.append(param)
if param in ['bulk_velocity', 'center', 'normal']:
return np.random.random(3) * 1e-2
+ elif param in ['axis']:
+ return 0
else:
return 0.0
_num_ghost_zones = 0
Repository URL: https://bitbucket.org/yt_analysis/yt-3.0/
--
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