Commits

Christopher Moody committed ede4ebb

fixed up field access in grids

  • Participants
  • Parent commits 52dca3a

Comments (0)

Files changed (1)

File yt/frontends/art/io.py

             'star_metallicity2':grid.star_metallicity2,
             'star_mass_initial':grid.star_mass_initial,
             'star_mass':grid.star_mass}
-         
-        return grid.field_dict[field]
+        starfield = field.replace('particle','star')
+        psi = grid.pf.particle_star_index
+        if field not in field_dict.keys() and starfield in field_dict.keys():
+            particle_field = np.zeros(grid.particle_mass.shape)                    
+            particle_field[grid.particle_id==psi]=field_dict[starfield]
+            return particle_field
+        else:
+            return field_dict[field]
 
         
     def _read_data_set(self, grid, field):