Commits

Britton Smith  committed 662c5f6

Added some extra examples.

  • Participants
  • Parent commits 84bc684

Comments (0)

Files changed (7)

File output/time_series.pdf

Binary file modified.

File scripts/time_series_analysis_task_max.py

+import glob
+from yt.mods import *
+
+my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")[0:2]
+ts = TimeSeriesData.from_filenames(my_filenames)
+print ts.tasks.keys()
+
+max_rho = ts.tasks["MaximumValue"]("Density")
+print max_rho

File scripts/time_series_analysis_task_slice.py

+from yt.mods import *
+
+my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")[0:2]
+ts = TimeSeriesData.from_filenames(my_filenames)
+
+ts.tasks['SlicePlotDataset'](center=[0.5, 0.5, 0.5],
+                             field='Density', axis=0)

File scripts/time_series_analysis_tasks.py

-import glob
-from yt.mods import *
-
-my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")[0:2]
-ts = TimeSeriesData.from_filenames(my_filenames)
-print ts.tasks.keys()
-
-max_rho = ts.tasks["MaximumValue"]("Density")
-print max_rho

File scripts/time_series_custom_analysis_task.py

     ptype = (dd["particle_type"] == params.particle_type)
     return (ptype.sum(), dd["ParticleMassMsun"][ptype].sum())
 
-my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")[0:2]
+my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")[43:45]
 ts = TimeSeriesData.from_filenames(my_filenames)
-ms = ts.tasks["MassInParticleType"](1)
+ms = ts.tasks["MassInParticleType"](2)
 print ms

File scripts/time_series_custom_slice.py

+from yt.mods import *
+
+@analysis_task(('center', 'field', 'axis', 'zlim'))
+def SliceWithArrows(params, pf):
+    pc = PlotCollection(pf, center=params.center)
+    pc.add_slice(params.field, params.axis)
+    pc.plots[0].modify['velocity']()
+    pc.set_zlim(params.zlim[0], params.zlim[1])
+    pc.save('%s_arrows' % pf.basename)
+    
+
+my_filenames = glob.glob("data/enzo_tiny_cosmology/*/*.hierarchy")
+ts = TimeSeriesData.from_filenames(my_filenames)
+
+ts.tasks['SliceWithArrows'](center=[0.5, 0.5, 0.5],
+                            field='Density', axis=0,
+                            zlim=(1e-31, 1e-27))

File time_series.tex

   \end{itemize}
 \end{frame}
 
-\begin{frame}[fragile, t]{{\small \texttt{time\_series\_analysis\_tasks.py}}}
+\begin{frame}[fragile, t]{{\small \texttt{time\_series\_analysis\_task\_max.py}}}
   \tiny
-  <<d['scripts/time_series_analysis_tasks.py|fn|pyg|l']>>
+  <<d['scripts/time_series_analysis_task_max.py|fn|pyg|l']>>
   \hline
-  <<d['scripts/time_series_analysis_tasks.py|fn|py|pyg|l']>>
+  <<d['scripts/time_series_analysis_task_max.py|fn|py|pyg|l']>>
+\end{frame}
+
+\begin{frame}[fragile, t]{{\small \texttt{time\_series\_analysis\_task\_slice.py}}}
+  \tiny
+  <<d['scripts/time_series_analysis_task_slice.py|fn|pyg|l']>>
+  \hline
+  <<d['scripts/time_series_analysis_task_slice.py|fn|py|pyg|l']>>
 \end{frame}
 
 \mediumsimple{Creating new analysis tasks is easy.}
   <<d['scripts/time_series_custom_analysis_task.py|fn|py|pyg|l']>>
 \end{frame}
 
+\begin{frame}[fragile, t]{{\small \texttt{time\_series\_custom\_slice.py}}}
+  \tiny
+  <<d['scripts/time_series_custom_slice.py|fn|pyg|l']>>
+  \hline
+  <<d['scripts/time_series_custom_slice.py|fn|py|pyg|l']>>
+\end{frame}
+
 \mediumsimple{Time-series analysis can be run in parallel with a group
   of processors working on each dataset.  The group can be all
   processors, a single processor, or a subset of all processors.}
   <<d['scripts/using_enzo_simulation.py|fn|pyg|l']>>
 \end{frame}
 
+\mediumsimple{Use an \texttt{EnzoSimulation} object the same way you
+  would a \texttt{TimeSeriesData} object.}
+
 \end{document}