[yt-svn] commit/yt-doc: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Wed Apr 10 10:23:48 PDT 2013
2 new commits in yt-doc:
https://bitbucket.org/yt_analysis/yt-doc/commits/b43b488444ea/
Changeset: b43b488444ea
User: atmyers
Date: 2013-03-15 19:14:02
Summary: adding a section to the derived fields docs about saving fields to the backup file
Affected #: 1 file
diff -r 9151fa38de9c9f5150078592c55244852a36482e -r b43b488444ea90990507967362819f54733cbe2e source/analyzing/creating_derived_fields.rst
--- a/source/analyzing/creating_derived_fields.rst
+++ b/source/analyzing/creating_derived_fields.rst
@@ -188,6 +188,37 @@
.. _derived-field-options:
+Saving Derived Fields
+---------------------
+
+Complex fields can be time-consuming to generate, especially on large datasets. To mitigate this, yt provides a mechanism for saving fields to a backup file using the Grid Data Format. The next time you start yt, it will check this file and your field will be treated as native if present.
+
+The code below creates a new derived field called "Entr" and saves it to disk:
+
+.. code-block:: python
+
+ from yt.mods import *
+ from yt.utilities.grid_data_format import writer
+
+ def _Entropy(field, data) :
+ return data["Temperature"]*data["Density"]**(-2./3.)
+ add_field("Entr", function=_Entropy)
+
+ pf = load('GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100')
+ writer.save_field(pf, "Entr")
+
+This creates a "_backup.gdf" file next to your datadump. If you load up the dataset again:
+
+.. code-block:: python
+
+ from yt.mods import *
+
+ pf = load('GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100')
+ data = pf.h.all_data()
+ print data["Entr"]
+
+you can work with the field exactly as before, without having to recompute it.
+
Field Options
-------------
https://bitbucket.org/yt_analysis/yt-doc/commits/1bcd066cb04a/
Changeset: 1bcd066cb04a
User: MatthewTurk
Date: 2013-04-10 19:23:45
Summary: Merged in atmyers/yt-doc (pull request #86)
adding a section to the derived fields docs about saving fields to the backup file
Affected #: 1 file
diff -r 26462bde1cd6c6eda7c422a2edb499dbeaf765a4 -r 1bcd066cb04af677efdda6581d103fbac9273c45 source/analyzing/creating_derived_fields.rst
--- a/source/analyzing/creating_derived_fields.rst
+++ b/source/analyzing/creating_derived_fields.rst
@@ -188,6 +188,37 @@
.. _derived-field-options:
+Saving Derived Fields
+---------------------
+
+Complex fields can be time-consuming to generate, especially on large datasets. To mitigate this, yt provides a mechanism for saving fields to a backup file using the Grid Data Format. The next time you start yt, it will check this file and your field will be treated as native if present.
+
+The code below creates a new derived field called "Entr" and saves it to disk:
+
+.. code-block:: python
+
+ from yt.mods import *
+ from yt.utilities.grid_data_format import writer
+
+ def _Entropy(field, data) :
+ return data["Temperature"]*data["Density"]**(-2./3.)
+ add_field("Entr", function=_Entropy)
+
+ pf = load('GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100')
+ writer.save_field(pf, "Entr")
+
+This creates a "_backup.gdf" file next to your datadump. If you load up the dataset again:
+
+.. code-block:: python
+
+ from yt.mods import *
+
+ pf = load('GasSloshing/sloshing_nomag2_hdf5_plt_cnt_0100')
+ data = pf.h.all_data()
+ print data["Entr"]
+
+you can work with the field exactly as before, without having to recompute it.
+
Field Options
-------------
Repository URL: https://bitbucket.org/yt_analysis/yt-doc/
--
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