Christopher Moody  committed 5a74167

Adding documentation for ART loading

  • Participants
  • Parent commits f2bbe04

Comments (0)

Files changed (1)

File source/analyzing/loading_data.rst

 ART Data
-ART data enjoys very preliminary support and is supported by Christopher Moody.
+ART data enjoys preliminary support and is supported by Christopher Moody.
 Please contact the ``yt-dev`` mailing list if you are interested in using yt
 for ART data, or if you are interested in assisting with development of yt to
 work with ART data.
+At the moment, the ART octree is 'regridded' at each level to make the native
+octree look more like a mesh-based code. As a result, the initial outlay
+is about ~60 seconds to grid octs onto a mesh. This will be improved in 
+``yt-3.0``, where octs will be supported natively. 
+To load an ART dataset you can use the ``load`` command provided by 
+``yt.mods`` and passing the gas mesh file. It will search for and attempt 
+to find the complementary dark matter and stellar particle header and data 
+files. However, your simulations may not follow the same naming convention,
+but you can specify the individual files.
+So for example, a single snapshot might have a series of files looking like
+.. code-block:: none
+    10MpcBox_csf512_a0.300.d    #Gas mesh
+    PMcrda0.300.DAT             #Particle header
+    PMcrs0a0.300.DAT            #Particle data (positions,velocities)
+    stars_a0.300.dat            #Stellar data (metallicities, ages, etc.)
+The ART frontend tries to find the associated files matching the above, but
+if that fails you can specify ``file_particle_data``,``file_particle_data``,
+``file_star_data`` in addition to the specifying the gas mesh. You also have 
+the option of gridding these particles, and assigning them onto the meshes.
+This process is in beta, and for the time being it's best to leave
+``do_grid_particles=False`` as the deault.
+To speed up the loading of an ART file, you have a few options. You can turn 
+off the particles entirely by setting ``discover_particles=False``. You can
+also only grid octs up to a certain level, ``limit_level=5``, which is useful
+when debugging by artificially creating a 'smaller' dataset to work with.
+Finally, when stellar ages are computed we 'spread' the ages evenly within a
+smoothing window. By default this is turned on and set to 10Myr. To turn this 
+off you can set ``spread=False``, and you can tweak the age smoothing window
+by specifying the window in seconds, ``spread=1.0e7*265*24*3600``. 
+:: code-block:: python
+    from yt.mods import *
+    file = "/u/cmoody3/data/art_snapshots/SFG1/10MpcBox_csf512_a0.460.d"
+    pf = load(file,discover_particles=True,grid_particles=2,limit_level=3)
+    pf.h.print_stats()
+    dd=pf.h.all_data()
+    print na.sum(dd['particle_type']==0)
+In the above example code, the first line imports the standard yt functions,
+followed by defining the gas mesh file, and load it only through level 3,
+but gridding particles through on to meshes on level 2 and higher. Finally, 
+we create a data container and ask it to gather the particle_type array. In 
+this case type==0 is for the most highly-refined dark matter particle, and 
+we print out how many high-resolution star particles we find in the simulation.
+Typically, however, you shouldn't have to specify any keyword arguments to load
+in a dataset.