[yt-users] creating sunrise files from RAMSES snapshot

Robert Feldmann feldmann at fnal.gov
Sat Aug 20 22:40:32 PDT 2011


Hi,

I am trying to create SUNRISE files for a RAMSES snapshot.
I am using the latest stable version of YT ("2.1stable"). I can read the RAMSES snapshot, but the sunrise_exporter routine fails.
The reason, it seems, is that it wants to access a field "InitialTime" that actually does not exist (see below).

Is there somewhere some additional information about how to convert RAMSES to SUNRISE using YT?
I could not find much (that includes searching the mailing lists). 

Thanks
Robert

>>> pf = load("output_00105/info_00105.txt")
output_00105/amr_00105.out00001
yt : [INFO     ] 2011-08-21 00:09:47,343 Parameters: current_time              = -1.23236270587e+17
yt : [INFO     ] 2011-08-21 00:09:47,343 Parameters: domain_dimensions         = [2 2 2]
yt : [INFO     ] 2011-08-21 00:09:47,344 Parameters: domain_left_edge          = [ 0.  0.  0.]
yt : [INFO     ] 2011-08-21 00:09:47,344 Parameters: domain_right_edge         = [ 1.  1.  1.]
yt : [INFO     ] 2011-08-21 00:09:47,344 Parameters: cosmological_simulation   = 1
yt : [INFO     ] 2011-08-21 00:09:47,345 Parameters: current_redshift          = 1.00027409463
yt : [INFO     ] 2011-08-21 00:09:47,345 Parameters: omega_lambda              = 0.759999990463
yt : [INFO     ] 2011-08-21 00:09:47,345 Parameters: omega_matter              = 0.239999994636
yt : [INFO     ] 2011-08-21 00:09:47,345 Parameters: hubble_constant           = 73.0

Now, when I try the following I get an error
>>> from yt.analysis_modules.sunrise_export import sunrise_exporter
>>> sunrise_exporter.export_to_sunrise(pf,"analysis/yt/HYDRO_L2_18_GF_epsstar0d1")
yt : [INFO     ] 2011-08-21 00:11:30,744 Re-gridding level 0: 1 octree grids
Re-gridding 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 
...
Re-gridding 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:0 
yt : [INFO     ] 2011-08-21 00:11:46,711 Final grid count: 302
yt : [INFO     ] 2011-08-21 00:11:46,775 Re-gridding level 16: 59069 octree grids
Re-gridding 100% ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:0 
yt : [INFO     ] 2011-08-21 00:11:47,093 Final grid count: 153
yt : [INFO     ] 2011-08-21 00:11:52,568 Getting field particle_type from 2894
yt : [INFO     ] 2011-08-21 00:11:52,760 Getting field particle_position_x from 2894
yt : [INFO     ] 2011-08-21 00:11:52,951 Getting field particle_position_y from 2894
yt : [INFO     ] 2011-08-21 00:11:53,141 Getting field particle_position_z from 2894
yt : [INFO     ] 2011-08-21 00:11:53,344 Getting field particle_velocity_x from 2894
yt : [INFO     ] 2011-08-21 00:11:53,542 Getting field particle_velocity_y from 2894
yt : [INFO     ] 2011-08-21 00:11:53,739 Getting field particle_velocity_z from 2894
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)

/d/scratch39/feldmann/local/yt/yt-x86_64/src/yt-hg/scripts/iyt in <module>()
----> 1 
      2 
      3 
      4 
      5 

/d/scratch39/feldmann/local/yt/yt-x86_64/src/yt-hg/yt/analysis_modules/sunrise_export/sunrise_exporter.pyc in export_to_sunrise(pf, fn, write_particles, sub gion_bounds, particle_mass, particle_pos, particle_age, particle_metal)
    110         # Velocity is cm/s, we want it to be kpc/yr

    111         vel *= (pf["kpc"]/pf["cm"]) / (365*24*3400.)
--> 112         age = pf["years"] * (pf["InitialTime"] - reg["creation_time"][pi])
    113         creation_time = reg["creation_time"][pi] * pf["years"]
    114 

/d/scratch39/feldmann/local/yt/yt-x86_64/src/yt-hg/yt/data_objects/static_output.pyc in __getitem__(self, key)
    117                   self.conversion_factors]:
    118             if key in d: return d[key]
--> 119         raise KeyError(key)
    120 
    121     def keys(self):

KeyError: 'InitialTime'

---

These are the available fields in pf

pf._StaticOutput__hierarchy       pf.__repr__                       pf._setup_nounits_units           pf.has_key
pf.__class__                      pf.__setattr__                    pf.basename                       pf.hierarchy
pf.__delattr__                    pf.__sizeof__                     pf.conversion_factors             pf.hubble_constant
pf.__dict__                       pf.__str__                        pf.cosmological_simulation        pf.keys
pf.__doc__                        pf.__subclasshook__               pf.current_redshift               pf.omega_lambda
pf.__format__                     pf.__weakref__                    pf.current_time                   pf.omega_matter
pf.__getattribute__               pf._fieldinfo_class               pf.data_style                     pf.parameter_filename
pf.__getitem__                    pf._get_hierarchy                 pf.dimensionality                 pf.parameters
pf.__hash__                       pf._handle                        pf.directory                      pf.print_key_parameters
pf.__init__                       pf._hash                          pf.domain_dimensions              pf.ramses_tree
pf.__iter__                       pf._hierarchy_class               pf.domain_left_edge               pf.refine_by
pf.__metaclass__                  pf._instantiated                  pf.domain_right_edge              pf.storage_filename
pf.__module__                     pf._is_valid                      pf.field_info                     pf.time_units
pf.__new__                        pf._parse_parameter_file          pf.fullpath                       pf.unique_identifier
pf.__reduce__                     pf._set_hierarchy                 pf.get_smallest_appropriate_unit  pf.units
pf.__reduce_ex__                  pf._set_units                     pf.h                              




More information about the yt-users mailing list