[yt-svn] commit/yt: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Fri May 30 11:03:05 PDT 2014


3 new commits in yt:

https://bitbucket.org/yt_analysis/yt/commits/ea1d847ab3d3/
Changeset:   ea1d847ab3d3
Branch:      yt-3.0
User:        jzuhone
Date:        2014-05-26 23:13:43
Summary:     First steps in fixing S-Z projections, but still broken.
Affected #:  2 files

diff -r b9d613a9f50e48f1b0133ab349735a6b1d3ad16d -r ea1d847ab3d37455a576fcc327906f248ce6b040 doc/source/analyzing/analysis_modules/SZ_projections.ipynb
--- a/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
+++ b/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:e5d3c629592c8aacbabf2e3fab2660703298886b8de6f36eb7cdc1f60b726496"
+  "signature": "sha256:e3bb386154467c6decf59ee52f0b45140ce707f23039b8d7794da0787731e1ac"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -18,7 +18,7 @@
       "projection of the pressure field of a cluster. However, the *full* S-Z signal is a combination of thermal and kinetic\n",
       "contributions, and for large frequencies and high temperatures\n",
       "relativistic effects are important. For computing the full S-Z signal\n",
-      "incorporating all of these effects, Jens Chluba has written a library:\n",
+      "incorporating all of these effects, there is a library:\n",
       "SZpack ([Chluba et al 2012](http://adsabs.harvard.edu/abs/2012MNRAS.426..510C)). \n",
       "\n",
       "The `sunyaev_zeldovich` analysis module in `yt` makes it possible\n",
@@ -93,10 +93,10 @@
       "from yt.mods import *\n",
       "from yt.analysis_modules.api import SZProjection\n",
       "\n",
-      "pf = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
+      "ds = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
       "\n",
       "freqs = [90.,180.,240.]\n",
-      "szprj = SZProjection(pf, freqs)"
+      "szprj = SZProjection(ds, freqs)"
      ],
      "language": "python",
      "metadata": {},

diff -r b9d613a9f50e48f1b0133ab349735a6b1d3ad16d -r ea1d847ab3d37455a576fcc327906f248ce6b040 yt/analysis_modules/sunyaev_zeldovich/projection.py
--- a/yt/analysis_modules/sunyaev_zeldovich/projection.py
+++ b/yt/analysis_modules/sunyaev_zeldovich/projection.py
@@ -36,35 +36,30 @@
     pass
 
 vlist = "xyz"
-def setup_sunyaev_zeldovich_fields(registry, ftype = "gas", slice_info = None):
+def setup_sunyaev_zeldovich_fields(ds):
     def _t_squared(field, data):
         return data["gas","density"]*data["gas","kT"]*data["gas","kT"]
-    registry.add_field(("gas", "t_squared"),
-                       function = _t_squared,
-                       units="g*keV**2/cm**3")
+    ds.add_field(("gas", "t_squared"), function = _t_squared,
+                 units="g*keV**2/cm**3")
     def _beta_perp_squared(field, data):
         return data["gas","density"]*data["gas","velocity_magnitude"]**2/clight/clight - data["gas","beta_par_squared"]
-    registry.add_field(("gas","beta_perp_squared"), 
-                       function = _beta_perp_squared,
-                       units="g/cm**3")
+    ds.add_field(("gas","beta_perp_squared"), function = _beta_perp_squared,
+                 units="g/cm**3")
 
     def _beta_par_squared(field, data):
         return data["gas","beta_par"]**2/data["gas","density"]
-    registry.add_field(("gas","beta_par_squared"),
-                       function = _beta_par_squared,
-                       units="g/cm**3")
+    ds.add_field(("gas","beta_par_squared"), function = _beta_par_squared,
+                 units="g/cm**3")
 
     def _t_beta_par(field, data):
         return data["gas","kT"]*data["gas","beta_par"]
-    registry.add_field(("gas","t_beta_par"),
-                       function = _t_beta_par,
-                       units="keV*g/cm**3")
+    ds.add_field(("gas","t_beta_par"), function = _t_beta_par,
+                 units="keV*g/cm**3")
 
     def _t_sz(field, data):
         return data["gas","density"]*data["gas","kT"]
-    registry.add_field(("gas","t_sz"),
-                       function = _t_sz,
-                       units="keV*g/cm**3")
+    ds.add_field(("gas","t_sz"), function = _t_sz,
+                 units="keV*g/cm**3")
 
 def generate_beta_par(L):
     def _beta_par(field, data):
@@ -79,8 +74,8 @@
 
     Parameters
     ----------
-    pf : parameter_file
-        The parameter file.
+    ds : Dataset
+        The dataset
     freqs : array_like
         The frequencies (in GHz) at which to compute the SZ spectral distortion.
     mue : float, optional
@@ -91,15 +86,15 @@
     Examples
     --------
     >>> freqs = [90., 180., 240.]
-    >>> szprj = SZProjection(pf, freqs, high_order=True)
+    >>> szprj = SZProjection(ds, freqs, high_order=True)
     """
-    def __init__(self, pf, freqs, mue=1.143, high_order=False):
+    def __init__(self, ds, freqs, mue=1.143, high_order=False):
 
-        self.pf = pf
-        pf.field_info.load_plugin(setup_sunyaev_zeldovich_fields)
+        self.ds = ds
+        setup_sunyaev_zeldovich_fields(self.ds)
         self.num_freqs = len(freqs)
         self.high_order = high_order
-        self.freqs = pf.arr(freqs, "GHz")
+        self.freqs = ds.arr(freqs, "GHz")
         self.mueinv = 1./mue
         self.xinit = hcgs*self.freqs.in_units("Hz")/(kboltz*Tcmb)
         self.freq_fields = ["%d_GHz" % (int(freq)) for freq in freqs]
@@ -132,12 +127,12 @@
         --------
         >>> szprj.on_axis("y", center="max", width=(1.0, "Mpc"), source=my_sphere)
         """
-        axis = fix_axis(axis, self.pf)
+        axis = fix_axis(axis, self.ds)
 
         if center == "c":
-            ctr = self.pf.domain_center
+            ctr = self.ds.domain_center
         elif center == "max":
-            v, ctr = self.pf.h.find_max("density")
+            v, ctr = self.ds.h.find_max("density")
         else:
             ctr = center
 
@@ -145,8 +140,8 @@
         L[axis] = 1.0
 
         beta_par = generate_beta_par(L)
-        self.pf.field_info.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
-        proj = self.pf.h.proj("density", axis, center=ctr, data_source=source)
+        self.ds.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
+        proj = self.ds.proj("density", axis, center=ctr, data_source=source)
         frb = proj.to_frb(width, nx)
         dens = frb["density"]
         Te = frb["t_sz"]/dens
@@ -171,7 +166,7 @@
                                 np.array(omega1), np.array(sigma1),
                                 np.array(kappa1), np.array(bperp2))
 
-        self.pf.field_info.pop(("gas","beta_par"))
+        self.ds.field_info.pop(("gas","beta_par"))
 
     def off_axis(self, L, center="c", width=(1, "unitary"), nx=800, source=None):
         r""" Make an off-axis projection of the SZ signal.
@@ -196,15 +191,15 @@
         >>> szprj.off_axis(L, center="c", width=(2.0, "Mpc"))
         """
         if iterable(width):
-            w = self.pf.quan(width[0], width[1]).in_units("code_length").value
+            w = self.ds.quan(width[0], width[1]).in_units("code_length").value
         elif isinstance(width, YTQuantity):
             w = width.in_units("code_length").value
         else:
             w = width
         if center == "c":
-            ctr = self.pf.domain_center
+            ctr = self.ds.domain_center
         elif center == "max":
-            v, ctr = self.pf.h.find_max("density")
+            v, ctr = self.ds.h.find_max("density")
         else:
             ctr = center
 
@@ -213,18 +208,18 @@
             raise NotImplementedError
 
         beta_par = generate_beta_par(L)
-        self.pf.field_info.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
+        self.ds.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
 
-        dens    = off_axis_projection(self.pf, ctr, L, w, nx, "density")
-        Te      = off_axis_projection(self.pf, ctr, L, w, nx, "t_sz")/dens
-        bpar    = off_axis_projection(self.pf, ctr, L, w, nx, "beta_par")/dens
-        omega1  = off_axis_projection(self.pf, ctr, L, w, nx, "t_squared")/dens
+        dens    = off_axis_projection(self.ds, ctr, L, w, nx, "density")
+        Te      = off_axis_projection(self.ds, ctr, L, w, nx, "t_sz")/dens
+        bpar    = off_axis_projection(self.ds, ctr, L, w, nx, "beta_par")/dens
+        omega1  = off_axis_projection(self.ds, ctr, L, w, nx, "t_squared")/dens
         omega1  = omega1/(Te*Te) - 1.
         if self.high_order:
-            bperp2  = off_axis_projection(self.pf, ctr, L, w, nx, "beta_perp_squared")/dens
-            sigma1  = off_axis_projection(self.pf, ctr, L, w, nx, "t_beta_par")/dens
+            bperp2  = off_axis_projection(self.ds, ctr, L, w, nx, "beta_perp_squared")/dens
+            sigma1  = off_axis_projection(self.ds, ctr, L, w, nx, "t_beta_par")/dens
             sigma1  = sigma1/Te - bpar
-            kappa1  = off_axis_projection(self.pf, ctr, L, w, nx, "beta_par_squared")/dens
+            kappa1  = off_axis_projection(self.ds, ctr, L, w, nx, "beta_par_squared")/dens
             kappa1 -= bpar
         else:
             bperp2 = np.zeros((nx,nx))
@@ -241,7 +236,7 @@
                                 np.array(omega1), np.array(sigma1),
                                 np.array(kappa1), np.array(bperp2))
 
-        self.pf.field_info.pop(("gas","beta_par"))
+        self.ds.field_info.pop(("gas","beta_par"))
 
     def _compute_intensity(self, tau, Te, bpar, omega1, sigma1, kappa1, bperp2):
 
@@ -278,8 +273,8 @@
 
         for i, field in enumerate(self.freq_fields):
             self.data[field] = I0*self.xinit[i]**3*signal[i,:,:]
-        self.data["Tau"] = self.pf.arr(tau, "dimensionless")
-        self.data["TeSZ"] = self.pf.arr(Te, "keV")
+        self.data["Tau"] = self.ds.arr(tau, "dimensionless")
+        self.data["TeSZ"] = self.ds.arr(Te, "keV")
 
     @parallel_root_only
     def write_fits(self, filename, units="kpc", sky_center=None, sky_scale=None,
@@ -327,7 +322,7 @@
         fib = FITSImageBuffer(self.data, fields=self.data.keys(),
                               center=center, units=units,
                               scale=deltas)
-        fib.update_all_headers("Time", float(self.pf.current_time.in_units(time_units).value))
+        fib.update_all_headers("Time", float(self.ds.current_time.in_units(time_units).value))
         fib.writeto(filename, clobber=clobber)
         
     @parallel_root_only


https://bitbucket.org/yt_analysis/yt/commits/a76ff96ec74f/
Changeset:   a76ff96ec74f
Branch:      yt-3.0
User:        jzuhone
Date:        2014-05-26 23:25:53
Summary:     Milliparsec again!
Affected #:  1 file

diff -r ea1d847ab3d37455a576fcc327906f248ce6b040 -r a76ff96ec74ff9bd30919f8ef2b50707a7ce16c2 doc/source/analyzing/analysis_modules/SZ_projections.ipynb
--- a/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
+++ b/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:e3bb386154467c6decf59ee52f0b45140ce707f23039b8d7794da0787731e1ac"
+  "signature": "sha256:7fc053480ba7896bfa5905bd69f7b3dd326364fbab324975b76f79640f2e0adf"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -108,8 +108,8 @@
      "source": [
       "`freqs` is a list or array of frequencies in GHz at which the signal\n",
       "is to be computed. The `SZProjection` constructor also accepts the\n",
-      "optional keywords, **mue** (mean molecular weight for computing the\n",
-      "electron number density, 1.143 is the default) and **high_order** (set\n",
+      "optional keywords, `mue` (mean molecular weight for computing the\n",
+      "electron number density, 1.143 is the default) and `high_order` (set\n",
       "to True to compute terms in the S-Z signal expansion up to\n",
       "second-order in $T_{e,SZ}$ and $\\beta$). "
      ]
@@ -127,7 +127,7 @@
      "collapsed": false,
      "input": [
       "# An on-axis projection along the z-axis with width 10 Mpc, centered on the gas density maximum\n",
-      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"mpc\"), nx=400)"
+      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"Mpc\"), nx=400)"
      ],
      "language": "python",
      "metadata": {},
@@ -144,7 +144,7 @@
       "which can be accessed dict-like from the projection object (e.g.,\n",
       "`szprj[\"90_GHz\"]`). Projections of other quantities may also be\n",
       "accessed; to see what fields are available call `szprj.keys()`. The methods also accept standard ``yt``\n",
-      "keywords for projections such as **center**, **width**, and **source**. The image buffer size can be controlled by setting **nx**.  \n"
+      "keywords for projections such as `center`, `width`, and `source`. The image buffer size can be controlled by setting `nx`.  \n"
      ]
     },
     {
@@ -216,8 +216,16 @@
      "source": [
       "which would write all of the projections to a single FITS file,\n",
       "including coordinate information in kpc. The optional keyword\n",
-      "**clobber** allows a previous file to be overwritten. \n"
+      "`clobber` allows a previous file to be overwritten. \n"
      ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
     }
    ],
    "metadata": {}


https://bitbucket.org/yt_analysis/yt/commits/d891a87e20d3/
Changeset:   d891a87e20d3
Branch:      yt-3.0
User:        ngoldbaum
Date:        2014-05-30 20:02:58
Summary:     Merged in jzuhone/yt-3.x/yt-3.0 (pull request #925)

Fixing S-Z projections
Affected #:  2 files

diff -r f1fa8e20ab513e87f18447c48c299cbee5fdfd39 -r d891a87e20d3afc80819da0c038a657169b43d1c doc/source/analyzing/analysis_modules/SZ_projections.ipynb
--- a/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
+++ b/doc/source/analyzing/analysis_modules/SZ_projections.ipynb
@@ -1,7 +1,7 @@
 {
  "metadata": {
   "name": "",
-  "signature": "sha256:e5d3c629592c8aacbabf2e3fab2660703298886b8de6f36eb7cdc1f60b726496"
+  "signature": "sha256:7fc053480ba7896bfa5905bd69f7b3dd326364fbab324975b76f79640f2e0adf"
  },
  "nbformat": 3,
  "nbformat_minor": 0,
@@ -18,7 +18,7 @@
       "projection of the pressure field of a cluster. However, the *full* S-Z signal is a combination of thermal and kinetic\n",
       "contributions, and for large frequencies and high temperatures\n",
       "relativistic effects are important. For computing the full S-Z signal\n",
-      "incorporating all of these effects, Jens Chluba has written a library:\n",
+      "incorporating all of these effects, there is a library:\n",
       "SZpack ([Chluba et al 2012](http://adsabs.harvard.edu/abs/2012MNRAS.426..510C)). \n",
       "\n",
       "The `sunyaev_zeldovich` analysis module in `yt` makes it possible\n",
@@ -93,10 +93,10 @@
       "from yt.mods import *\n",
       "from yt.analysis_modules.api import SZProjection\n",
       "\n",
-      "pf = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
+      "ds = load(\"enzo_tiny_cosmology/DD0046/DD0046\")\n",
       "\n",
       "freqs = [90.,180.,240.]\n",
-      "szprj = SZProjection(pf, freqs)"
+      "szprj = SZProjection(ds, freqs)"
      ],
      "language": "python",
      "metadata": {},
@@ -108,8 +108,8 @@
      "source": [
       "`freqs` is a list or array of frequencies in GHz at which the signal\n",
       "is to be computed. The `SZProjection` constructor also accepts the\n",
-      "optional keywords, **mue** (mean molecular weight for computing the\n",
-      "electron number density, 1.143 is the default) and **high_order** (set\n",
+      "optional keywords, `mue` (mean molecular weight for computing the\n",
+      "electron number density, 1.143 is the default) and `high_order` (set\n",
       "to True to compute terms in the S-Z signal expansion up to\n",
       "second-order in $T_{e,SZ}$ and $\\beta$). "
      ]
@@ -127,7 +127,7 @@
      "collapsed": false,
      "input": [
       "# An on-axis projection along the z-axis with width 10 Mpc, centered on the gas density maximum\n",
-      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"mpc\"), nx=400)"
+      "szprj.on_axis(\"z\", center=\"max\", width=(10.0, \"Mpc\"), nx=400)"
      ],
      "language": "python",
      "metadata": {},
@@ -144,7 +144,7 @@
       "which can be accessed dict-like from the projection object (e.g.,\n",
       "`szprj[\"90_GHz\"]`). Projections of other quantities may also be\n",
       "accessed; to see what fields are available call `szprj.keys()`. The methods also accept standard ``yt``\n",
-      "keywords for projections such as **center**, **width**, and **source**. The image buffer size can be controlled by setting **nx**.  \n"
+      "keywords for projections such as `center`, `width`, and `source`. The image buffer size can be controlled by setting `nx`.  \n"
      ]
     },
     {
@@ -216,8 +216,16 @@
      "source": [
       "which would write all of the projections to a single FITS file,\n",
       "including coordinate information in kpc. The optional keyword\n",
-      "**clobber** allows a previous file to be overwritten. \n"
+      "`clobber` allows a previous file to be overwritten. \n"
      ]
+    },
+    {
+     "cell_type": "code",
+     "collapsed": false,
+     "input": [],
+     "language": "python",
+     "metadata": {},
+     "outputs": []
     }
    ],
    "metadata": {}

diff -r f1fa8e20ab513e87f18447c48c299cbee5fdfd39 -r d891a87e20d3afc80819da0c038a657169b43d1c yt/analysis_modules/sunyaev_zeldovich/projection.py
--- a/yt/analysis_modules/sunyaev_zeldovich/projection.py
+++ b/yt/analysis_modules/sunyaev_zeldovich/projection.py
@@ -36,35 +36,30 @@
     pass
 
 vlist = "xyz"
-def setup_sunyaev_zeldovich_fields(registry, ftype = "gas", slice_info = None):
+def setup_sunyaev_zeldovich_fields(ds):
     def _t_squared(field, data):
         return data["gas","density"]*data["gas","kT"]*data["gas","kT"]
-    registry.add_field(("gas", "t_squared"),
-                       function = _t_squared,
-                       units="g*keV**2/cm**3")
+    ds.add_field(("gas", "t_squared"), function = _t_squared,
+                 units="g*keV**2/cm**3")
     def _beta_perp_squared(field, data):
         return data["gas","density"]*data["gas","velocity_magnitude"]**2/clight/clight - data["gas","beta_par_squared"]
-    registry.add_field(("gas","beta_perp_squared"), 
-                       function = _beta_perp_squared,
-                       units="g/cm**3")
+    ds.add_field(("gas","beta_perp_squared"), function = _beta_perp_squared,
+                 units="g/cm**3")
 
     def _beta_par_squared(field, data):
         return data["gas","beta_par"]**2/data["gas","density"]
-    registry.add_field(("gas","beta_par_squared"),
-                       function = _beta_par_squared,
-                       units="g/cm**3")
+    ds.add_field(("gas","beta_par_squared"), function = _beta_par_squared,
+                 units="g/cm**3")
 
     def _t_beta_par(field, data):
         return data["gas","kT"]*data["gas","beta_par"]
-    registry.add_field(("gas","t_beta_par"),
-                       function = _t_beta_par,
-                       units="keV*g/cm**3")
+    ds.add_field(("gas","t_beta_par"), function = _t_beta_par,
+                 units="keV*g/cm**3")
 
     def _t_sz(field, data):
         return data["gas","density"]*data["gas","kT"]
-    registry.add_field(("gas","t_sz"),
-                       function = _t_sz,
-                       units="keV*g/cm**3")
+    ds.add_field(("gas","t_sz"), function = _t_sz,
+                 units="keV*g/cm**3")
 
 def generate_beta_par(L):
     def _beta_par(field, data):
@@ -79,8 +74,8 @@
 
     Parameters
     ----------
-    pf : parameter_file
-        The parameter file.
+    ds : Dataset
+        The dataset
     freqs : array_like
         The frequencies (in GHz) at which to compute the SZ spectral distortion.
     mue : float, optional
@@ -91,15 +86,15 @@
     Examples
     --------
     >>> freqs = [90., 180., 240.]
-    >>> szprj = SZProjection(pf, freqs, high_order=True)
+    >>> szprj = SZProjection(ds, freqs, high_order=True)
     """
-    def __init__(self, pf, freqs, mue=1.143, high_order=False):
+    def __init__(self, ds, freqs, mue=1.143, high_order=False):
 
-        self.pf = pf
-        pf.field_info.load_plugin(setup_sunyaev_zeldovich_fields)
+        self.ds = ds
+        setup_sunyaev_zeldovich_fields(self.ds)
         self.num_freqs = len(freqs)
         self.high_order = high_order
-        self.freqs = pf.arr(freqs, "GHz")
+        self.freqs = ds.arr(freqs, "GHz")
         self.mueinv = 1./mue
         self.xinit = hcgs*self.freqs.in_units("Hz")/(kboltz*Tcmb)
         self.freq_fields = ["%d_GHz" % (int(freq)) for freq in freqs]
@@ -132,12 +127,12 @@
         --------
         >>> szprj.on_axis("y", center="max", width=(1.0, "Mpc"), source=my_sphere)
         """
-        axis = fix_axis(axis, self.pf)
+        axis = fix_axis(axis, self.ds)
 
         if center == "c":
-            ctr = self.pf.domain_center
+            ctr = self.ds.domain_center
         elif center == "max":
-            v, ctr = self.pf.h.find_max("density")
+            v, ctr = self.ds.h.find_max("density")
         else:
             ctr = center
 
@@ -145,8 +140,8 @@
         L[axis] = 1.0
 
         beta_par = generate_beta_par(L)
-        self.pf.field_info.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
-        proj = self.pf.h.proj("density", axis, center=ctr, data_source=source)
+        self.ds.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
+        proj = self.ds.proj("density", axis, center=ctr, data_source=source)
         frb = proj.to_frb(width, nx)
         dens = frb["density"]
         Te = frb["t_sz"]/dens
@@ -171,7 +166,7 @@
                                 np.array(omega1), np.array(sigma1),
                                 np.array(kappa1), np.array(bperp2))
 
-        self.pf.field_info.pop(("gas","beta_par"))
+        self.ds.field_info.pop(("gas","beta_par"))
 
     def off_axis(self, L, center="c", width=(1, "unitary"), nx=800, source=None):
         r""" Make an off-axis projection of the SZ signal.
@@ -196,15 +191,15 @@
         >>> szprj.off_axis(L, center="c", width=(2.0, "Mpc"))
         """
         if iterable(width):
-            w = self.pf.quan(width[0], width[1]).in_units("code_length").value
+            w = self.ds.quan(width[0], width[1]).in_units("code_length").value
         elif isinstance(width, YTQuantity):
             w = width.in_units("code_length").value
         else:
             w = width
         if center == "c":
-            ctr = self.pf.domain_center
+            ctr = self.ds.domain_center
         elif center == "max":
-            v, ctr = self.pf.h.find_max("density")
+            v, ctr = self.ds.h.find_max("density")
         else:
             ctr = center
 
@@ -213,18 +208,18 @@
             raise NotImplementedError
 
         beta_par = generate_beta_par(L)
-        self.pf.field_info.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
+        self.ds.add_field(("gas","beta_par"), function=beta_par, units="g/cm**3")
 
-        dens    = off_axis_projection(self.pf, ctr, L, w, nx, "density")
-        Te      = off_axis_projection(self.pf, ctr, L, w, nx, "t_sz")/dens
-        bpar    = off_axis_projection(self.pf, ctr, L, w, nx, "beta_par")/dens
-        omega1  = off_axis_projection(self.pf, ctr, L, w, nx, "t_squared")/dens
+        dens    = off_axis_projection(self.ds, ctr, L, w, nx, "density")
+        Te      = off_axis_projection(self.ds, ctr, L, w, nx, "t_sz")/dens
+        bpar    = off_axis_projection(self.ds, ctr, L, w, nx, "beta_par")/dens
+        omega1  = off_axis_projection(self.ds, ctr, L, w, nx, "t_squared")/dens
         omega1  = omega1/(Te*Te) - 1.
         if self.high_order:
-            bperp2  = off_axis_projection(self.pf, ctr, L, w, nx, "beta_perp_squared")/dens
-            sigma1  = off_axis_projection(self.pf, ctr, L, w, nx, "t_beta_par")/dens
+            bperp2  = off_axis_projection(self.ds, ctr, L, w, nx, "beta_perp_squared")/dens
+            sigma1  = off_axis_projection(self.ds, ctr, L, w, nx, "t_beta_par")/dens
             sigma1  = sigma1/Te - bpar
-            kappa1  = off_axis_projection(self.pf, ctr, L, w, nx, "beta_par_squared")/dens
+            kappa1  = off_axis_projection(self.ds, ctr, L, w, nx, "beta_par_squared")/dens
             kappa1 -= bpar
         else:
             bperp2 = np.zeros((nx,nx))
@@ -241,7 +236,7 @@
                                 np.array(omega1), np.array(sigma1),
                                 np.array(kappa1), np.array(bperp2))
 
-        self.pf.field_info.pop(("gas","beta_par"))
+        self.ds.field_info.pop(("gas","beta_par"))
 
     def _compute_intensity(self, tau, Te, bpar, omega1, sigma1, kappa1, bperp2):
 
@@ -278,8 +273,8 @@
 
         for i, field in enumerate(self.freq_fields):
             self.data[field] = I0*self.xinit[i]**3*signal[i,:,:]
-        self.data["Tau"] = self.pf.arr(tau, "dimensionless")
-        self.data["TeSZ"] = self.pf.arr(Te, "keV")
+        self.data["Tau"] = self.ds.arr(tau, "dimensionless")
+        self.data["TeSZ"] = self.ds.arr(Te, "keV")
 
     @parallel_root_only
     def write_fits(self, filename, units="kpc", sky_center=None, sky_scale=None,
@@ -327,7 +322,7 @@
         fib = FITSImageBuffer(self.data, fields=self.data.keys(),
                               center=center, units=units,
                               scale=deltas)
-        fib.update_all_headers("Time", float(self.pf.current_time.in_units(time_units).value))
+        fib.update_all_headers("Time", float(self.ds.current_time.in_units(time_units).value))
         fib.writeto(filename, clobber=clobber)
         
     @parallel_root_only

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