[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed May 7 00:44:27 PDT 2014
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/ced8c2e7e8c8/
Changeset: ced8c2e7e8c8
Branch: yt-3.0
User: MatthewTurk
Date: 2014-05-06 22:43:21
Summary: Fixing some doc builds
Affected #: 1 file
diff -r 15d24171e3fafdc3e6744984787f635eede0cadc -r ced8c2e7e8c8fdb8156656d73000238136b1fff1 doc/source/analyzing/analysis_modules/halo_catalogs.rst
--- a/doc/source/analyzing/analysis_modules/halo_catalogs.rst
+++ b/doc/source/analyzing/analysis_modules/halo_catalogs.rst
@@ -15,11 +15,12 @@
details on the relative differences between these halo finders see
:ref:`halo_finding`.
-.. code-block::
- from yt.mods import *
- from yt.analysis_modules.halo_analysis.api import HaloCatalog
- data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
- hc = HaloCatalog(data_pf=data_pf, finder_method='hop')
+.. code-block:: python
+
+ from yt.mods import *
+ from yt.analysis_modules.halo_analysis.api import HaloCatalog
+ data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
+ hc = HaloCatalog(data_pf=data_pf, finder_method='hop')
A halo catalog may also be created from already run rockstar outputs.
This method is not implemented for previously run friends-of-friends or
@@ -28,9 +29,10 @@
only specify the file output by the processor with ID 0. Note that the
argument for supplying a rockstar output is `halos_pf`, not `data_pf`.
-.. code-block::
- halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
- hc = HaloCatalog(halos_pf=halos_pf)
+.. code-block:: python
+
+ halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
+ hc = HaloCatalog(halos_pf=halos_pf)
Although supplying only the binary output of the rockstar halo finder
is sufficient for creating a halo catalog, it is not possible to find
@@ -38,10 +40,11 @@
with the dataset from which they were found, supply arguments to both
halos_pf and data_pf.
-.. code-block::
- halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
- data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
- hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf)
+.. code-block:: python
+
+ halos_pf = load(path+'rockstar_halos/halos_0.0.bin')
+ data_pf = load('Enzo_64/RD0006/RedshiftOutput0006')
+ hc = HaloCatalog(data_pf=data_pf, halos_pf=halos_pf)
A data container can also be supplied via keyword data_source,
associated with either dataset, to control the spatial region in
@@ -72,9 +75,9 @@
An example of adding a filter:
-.. code-block::
+.. code-block:: python
- hc.add_filter('quantity_value', 'particle_mass', '>', 1E13, 'Msun')
+ hc.add_filter('quantity_value', 'particle_mass', '>', 1E13, 'Msun')
Currently quantity_value is the only available filter, but more can be
added by the user by defining a function that accepts a halo object as
@@ -85,20 +88,21 @@
An example of defining your own filter:
-.. code-block::
- def my_filter_function(halo):
-
- # Define condition for filter
- filter_value = True
-
- # Return a boolean value
- return filter_value
+.. code-block:: python
- # Add your filter to the filter registry
- add_filter("my_filter", my_filter_function)
+ def my_filter_function(halo):
+
+ # Define condition for filter
+ filter_value = True
+
+ # Return a boolean value
+ return filter_value
- # ... Later on in your script
- hc.add_filter("my_filter")
+ # Add your filter to the filter registry
+ add_filter("my_filter", my_filter_function)
+
+ # ... Later on in your script
+ hc.add_filter("my_filter")
Quantities
----------
@@ -118,25 +122,26 @@
An example of adding a quantity:
-.. code-block::
- hc.add_quantity('center_of_mass')
+.. code-block:: python
+
+ hc.add_quantity('center_of_mass')
An example of defining your own quantity:
-.. code-block::
+.. code-block:: python
- def my_quantity_function(halo):
- # Define quantity to return
- quantity = 5
-
- return quantity
+ def my_quantity_function(halo):
+ # Define quantity to return
+ quantity = 5
+
+ return quantity
- # Add your filter to the filter registry
- add_quantity('my_quantity', my_quantity_function)
+ # Add your filter to the filter registry
+ add_quantity('my_quantity', my_quantity_function)
- # ... Later on in your script
- hc.add_quantity("my_quantity")
+ # ... Later on in your script
+ hc.add_quantity("my_quantity")
Callbacks
---------
@@ -150,8 +155,9 @@
An example of using a pre-defined callback where we create a sphere for
each halo with a radius that is twice the saved “radius”.
-.. code-block::
- hc.add_callback("sphere", factor=2.0)
+.. code-block:: python
+
+ hc.add_callback("sphere", factor=2.0)
Currently available callbacks are located in
yt/analysis_modules/halo_analysis/halo_callbacks.py. New callbacks may
@@ -161,19 +167,19 @@
An example of defining your own callback:
-.. code-block::
+.. code-block:: python
- def my_callback_function(halo):
- # Perform some callback actions here
- x = 2
- halo.x_val = x
+ def my_callback_function(halo):
+ # Perform some callback actions here
+ x = 2
+ halo.x_val = x
- # Add the callback to the callback registry
- add_callback('my_callback', my_callback_function)
+ # Add the callback to the callback registry
+ add_callback('my_callback', my_callback_function)
- # ... Later on in your script
- hc.add_callback("my_callback")
+ # ... Later on in your script
+ hc.add_callback("my_callback")
Running Analysis
================
@@ -181,8 +187,9 @@
After all callbacks, quantities, and filters have been added, the
analysis begins with a call to HaloCatalog.create.
-.. code-block::
- hc.create()
+.. code-block:: python
+
+ hc.create()
The save_halos keyword determines whether the actual Halo objects
are saved after analysis on them has completed or whether just the
@@ -206,13 +213,14 @@
standard call to load. Any side data, such as profiles, can be reloaded
with a load_profiles callback and a call to HaloCatalog.load.
-.. code-block::
- hpf = load(path+"halo_catalogs/catalog_0046/catalog_0046.0.h5")
- hc = HaloCatalog(halos_pf=hpf,
- output_dir="halo_catalogs/catalog_0046")
- hc.add_callback("load_profiles", output_dir="profiles",
- filename="virial_profiles")
- hc.load()
+.. code-block:: python
+
+ hpf = load(path+"halo_catalogs/catalog_0046/catalog_0046.0.h5")
+ hc = HaloCatalog(halos_pf=hpf,
+ output_dir="halo_catalogs/catalog_0046")
+ hc.add_callback("load_profiles", output_dir="profiles",
+ filename="virial_profiles")
+ hc.load()
Summary
=======
https://bitbucket.org/yt_analysis/yt/commits/4659f07ba33d/
Changeset: 4659f07ba33d
Branch: yt-3.0
User: MatthewTurk
Date: 2014-05-06 23:02:11
Summary: A few more doc build fixes
Affected #: 1 file
diff -r ced8c2e7e8c8fdb8156656d73000238136b1fff1 -r 4659f07ba33d63ced3a7d9424c0f033a1f08b3da doc/source/examining/loading_data.rst
--- a/doc/source/examining/loading_data.rst
+++ b/doc/source/examining/loading_data.rst
@@ -282,7 +282,7 @@
.. code-block:: python
- ( "Gas", "Halo", "Disk", "Bulge", "Stars", "Bndry" )
+ ( "Gas", "Halo", "Disk", "Bulge", "Stars", "Bndry" )
You can specify alternate names, but note that this may cause problems with the
field specification if none of the names match old names.
@@ -300,23 +300,23 @@
.. code-block:: python
- default = (('Npart', 6, 'i'),
- ('Massarr', 6, 'd'),
- ('Time', 1, 'd'),
- ('Redshift', 1, 'd'),
- ('FlagSfr', 1, 'i'),
- ('FlagFeedback', 1, 'i'),
- ('Nall', 6, 'i'),
- ('FlagCooling', 1, 'i'),
- ('NumFiles', 1, 'i'),
- ('BoxSize', 1, 'd'),
- ('Omega0', 1, 'd'),
- ('OmegaLambda', 1, 'd'),
- ('HubbleParam', 1, 'd'),
- ('FlagAge', 1, 'i'),
- ('FlagMEtals', 1, 'i'),
- ('NallHW', 6, 'i'),
- ('unused', 16, 'i'))
+ default = (('Npart', 6, 'i'),
+ ('Massarr', 6, 'd'),
+ ('Time', 1, 'd'),
+ ('Redshift', 1, 'd'),
+ ('FlagSfr', 1, 'i'),
+ ('FlagFeedback', 1, 'i'),
+ ('Nall', 6, 'i'),
+ ('FlagCooling', 1, 'i'),
+ ('NumFiles', 1, 'i'),
+ ('BoxSize', 1, 'd'),
+ ('Omega0', 1, 'd'),
+ ('OmegaLambda', 1, 'd'),
+ ('HubbleParam', 1, 'd'),
+ ('FlagAge', 1, 'i'),
+ ('FlagMEtals', 1, 'i'),
+ ('NallHW', 6, 'i'),
+ ('unused', 16, 'i'))
These items will all be accessible inside the object ``pf.parameters``, which
is a dictionary. You can add combinations of new items, specified in the same
@@ -371,7 +371,7 @@
.. code-block:: python
- ds = load("./halo1e11_run1.00400")
+ ds = load("./halo1e11_run1.00400")
.. _specifying-cosmology-tipsy:
@@ -414,7 +414,7 @@
.. code-block:: python
- ds = load("./A11QR1/s11Qzm1h2_a1.0000.art")
+ ds = load("./A11QR1/s11Qzm1h2_a1.0000.art")
.. _loading-art-data:
@@ -556,24 +556,24 @@
.. code-block:: python
- from yt.mods import *
- ds = load("m33_hi.fits")
- ds.print_stats()
+ from yt.mods import *
+ ds = load("m33_hi.fits")
+ ds.print_stats()
.. parsed-literal::
- level # grids # cells # cells^3
- ----------------------------------------------
- 0 512 981940800 994
- ----------------------------------------------
- 512 981940800
+ level # grids # cells # cells^3
+ ----------------------------------------------
+ 0 512 981940800 994
+ ----------------------------------------------
+ 512 981940800
yt will generate its own domain decomposition, but the number of grids can be
set manually by passing the ``nprocs`` parameter to the ``load`` call:
.. code-block:: python
- ds = load("m33_hi.fits", nprocs=1024)
+ ds = load("m33_hi.fits", nprocs=1024)
Making the Most of `yt` for FITS Data
+++++++++++++++++++++++++++++++++++++
@@ -596,12 +596,12 @@
.. code-block:: python
- import astropy.io.fits as pyfits
- f = pyfits.open("xray_flux_image.fits", mode="update")
- f[0].header["BUNIT"] = "cts/s/pixel"
- f[0].header["BTYPE"] = "flux"
- f.flush()
- f.close()
+ import astropy.io.fits as pyfits
+ f = pyfits.open("xray_flux_image.fits", mode="update")
+ f[0].header["BUNIT"] = "cts/s/pixel"
+ f[0].header["BTYPE"] = "flux"
+ f.flush()
+ f.close()
FITS Coordinates
++++++++++++++++
@@ -651,7 +651,7 @@
.. code-block:: python
- ds = load("flux.fits", auxiliary_files=["temp.fits","metal.fits"])
+ ds = load("flux.fits", auxiliary_files=["temp.fits","metal.fits"])
The image blocks in each of these files will be loaded as a separate field,
provided they have the same dimensions as the image blocks in the main file.
@@ -681,13 +681,13 @@
single floating-point number (applies to all fields) or a Python dictionary
containing different mask values for different fields:
-.. code-block::
+.. code-block:: python
- # passing a single float
- ds = load("m33_hi.fits", nan_mask=0.0)
+ # passing a single float
+ ds = load("m33_hi.fits", nan_mask=0.0)
- # passing a dict
- ds = load("m33_hi.fits", nan_mask={"intensity":-1.0,"temperature":0.0})
+ # passing a dict
+ ds = load("m33_hi.fits", nan_mask={"intensity":-1.0,"temperature":0.0})
Generally, AstroPy may generate a lot of warnings about individual FITS
files, many of which you may want to ignore. If you want to see these
@@ -798,9 +798,9 @@
.. code-block:: python
- for g in grid_data:
- g["number_of_particles"] = 100000
- g["particle_position_x"] = np.random.random((g["number_of_particles"]))
+ for g in grid_data:
+ g["number_of_particles"] = 100000
+ g["particle_position_x"] = np.random.random((g["number_of_particles"]))
.. rubric:: Caveats
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