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
Hey Robert How r u? Weekend going well? Would be great if u were out in Aspen! Sent from my iPhone On Aug 20, 2011, at 11:40 PM, Robert Feldmann <feldmann@fnal.gov> wrote:
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
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Robert, On Sun, Aug 21, 2011 at 1:40 AM, Robert Feldmann <feldmann@fnal.gov> wrote:
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).
I've fixed the bug you have reported, but in the unstable (2.2-dev) version, which also includes a large number of performance improvements for the RAMSES code. (We hope to have a 2.2 release this week.) There seem to be a few lingering bugs with the RAMSES reader which I am going to work on tomorrow; it seems that something I did recently broke the reader. However, the bigger issue arises in that right now the particle reading capabilities for RAMSES datasets are extremely limited, and will not support generating stellar populations, which are necessary to get useful information out of Sunrise. If you are looking for an output that contains only gas, then it should work fine (once I have had a chance to properly fix the item I mentioned above, as I am taking today off) to export, as long as "Temperature" exists in the output, although the result from Sunrise may not be as interesting. Oddly enough, it looks like from the output you have sent, yours is in fact reading particles. Have you made modifications? I'd be happy to talk with you about how to improve particle reading support for RAMSES to this end, however -- I think this particular problem could be solved by a small amount of special purpose code. Contact me off-list or on yt-dev and we can go from there. There has been a lot of interest in improving RAMSES support lately, which is also one of my goals for the near/medium future. -Matt
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
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Robert, On Sun, Aug 21, 2011 at 10:10 AM, Matthew Turk <matthewturk@gmail.com> wrote:
Hi Robert,
On Sun, Aug 21, 2011 at 1:40 AM, Robert Feldmann <feldmann@fnal.gov> wrote:
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).
I've fixed the bug you have reported, but in the unstable (2.2-dev) version, which also includes a large number of performance improvements for the RAMSES code. (We hope to have a 2.2 release this week.) There seem to be a few lingering bugs with the RAMSES reader which I am going to work on tomorrow; it seems that something I did recently broke the reader.
Apologies for the rapid self-reply, but I believe I have identified and fixed the main issue I was seeing with the RAMSES reader, and as of changeset hash 677ae185471f (in the "development" branch) it should actually be performing up to specification, and I was able to project and slice data successfully. Tomorrow I will dive deeper and ensure that the second-tier tests are working up to specification. RAMSES tests will be added to the automated test runner tomorrow morning, to be run on a daily basis, to ensure such a regression does not happen again. As always, please let us know if you run into problems. Best, Matt
However, the bigger issue arises in that right now the particle reading capabilities for RAMSES datasets are extremely limited, and will not support generating stellar populations, which are necessary to get useful information out of Sunrise. If you are looking for an output that contains only gas, then it should work fine (once I have had a chance to properly fix the item I mentioned above, as I am taking today off) to export, as long as "Temperature" exists in the output, although the result from Sunrise may not be as interesting. Oddly enough, it looks like from the output you have sent, yours is in fact reading particles. Have you made modifications?
I'd be happy to talk with you about how to improve particle reading support for RAMSES to this end, however -- I think this particular problem could be solved by a small amount of special purpose code. Contact me off-list or on yt-dev and we can go from there. There has been a lot of interest in improving RAMSES support lately, which is also one of my goals for the near/medium future.
-Matt
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
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Matt, Thanks for looking into it. Yet, the 2.2dev version still fails. First, there is an issue when I load the RAMSES snapshot.
pf=load("output_00105/info_00105.txt") output_00105/amr_00105.out00001 yt : [INFO ] 2011-08-21 19:15:20,777 Parameters: current_time = -1.23236270587e+17 yt : [INFO ] 2011-08-21 19:15:20,777 Parameters: domain_dimensions = [2 2 2] yt : [INFO ] 2011-08-21 19:15:20,778 Parameters: domain_left_edge = [ 0. 0. 0.] yt : [INFO ] 2011-08-21 19:15:20,778 Parameters: domain_right_edge = [ 1. 1. 1.] yt : [ERROR ] 2011-08-21 19:15:20,778 Missing cosmological_simulation in parameter file definition!
Yet, despite this error message it does seem to read the RAMSES snapshot. These are the available fields pf.__class__ pf.__repr__ pf._setup_nounits_units pf.has_key pf.__delattr__ pf.__setattr__ pf.basename pf.hierarchy pf.__dict__ pf.__sizeof__ pf.conversion_factors pf.keys pf.__doc__ pf.__str__ pf.current_time pf.parameter_filename pf.__format__ pf.__subclasshook__ pf.data_style pf.parameters pf.__getattribute__ pf.__weakref__ pf.dimensionality pf.print_key_parameters pf.__getitem__ pf._fieldinfo_class pf.directory pf.ramses_tree pf.__hash__ pf._handle pf.domain_dimensions pf.refine_by pf.__init__ pf._hash pf.domain_left_edge pf.storage_filename pf.__iter__ pf._hierarchy_class pf.domain_right_edge pf.time_units pf.__metaclass__ pf._instantiated pf.field_info pf.unique_identifier pf.__module__ pf._instantiated_hierarchy pf.file_style pf.units pf.__new__ pf._is_valid pf.fullpath pf.__reduce__ pf._parse_parameter_file pf.get_smallest_appropriate_unit pf.__reduce_ex__ pf._set_units pf.h Then when I try to export it, I still 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 19:16:38,412 Re-gridding level 0: 1 octree grids Re-gridding 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 ... yt : [INFO ] 2011-08-21 19:16:44,489 Final grid count: 303 yt : [INFO ] 2011-08-21 19:16:44,534 Re-gridding level 16: 59069 octree grids Re-gridding 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 472552 yt : [INFO ] 2011-08-21 19:16:44,680 Final grid count: 153 int32 yt : [INFO ] 2011-08-21 19:16:45,227 Getting field particle_type from 3250 yt : [INFO ] 2011-08-21 19:16:45,433 Getting field particle_position_x from 3250 yt : [INFO ] 2011-08-21 19:16:45,647 Getting field particle_position_y from 3250 yt : [INFO ] 2011-08-21 19:16:45,858 Getting field particle_position_z from 3250 yt : [INFO ] 2011-08-21 19:16:46,085 Getting field particle_velocity_x from 3250 yt : [INFO ] 2011-08-21 19:16:46,304 Getting field particle_velocity_y from 3250 yt : [INFO ] 2011-08-21 19:16:46,523 Getting field particle_velocity_z from 3250 ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (1340, 0))
ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (54, 0)) --------------------------------------------------------------------------- NeedsDataField Traceback (most recent call last) /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/scripts/iyt in <module>() ----> 1 2 3 4 5 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/analysis_modules/sunrise_export/sunrise_exporter.pyc in export_to_sunrise(pf, fn, write_particles, subregion_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.current_time - reg["creation_time"][pi]) 113 creation_time = reg["creation_time"][pi] * pf["years"] 114 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __getitem__(self, key) 285 if key not in self.fields: 286 self.fields.append(key) --> 287 self.get_data(key) 288 return self.data[key] 289 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in get_data(self, fields, in_grids, force_particle_read) 2289 continue 2290 if field not in self.hierarchy.field_list and not in_grids: -> 2291 if self._generate_field(field): 2292 continue # True means we already assigned it 2293 # There are a lot of 'ands' here, but I think they are all /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in _generate_field(self, field) 2356 except NeedsGridType, ngt_exception: 2357 # We leave this to be implementation-specific -> 2358 self._generate_field_in_grids(field, ngt_exception.ghost_zones) 2359 return False 2360 else: /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in _generate_field_in_grids(self, field, num_ghost_zones) 2366 def _generate_field_in_grids(self, field, num_ghost_zones=0): 2367 for grid in self._grids: -> 2368 self.__touch_grid_field(grid, field) 2369 2370 @restore_grid_state /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in save_state(self, grid, field) 72 old_keys = grid.data.keys() 73 grid.field_parameters = self.field_parameters ---> 74 tr = func(self, grid, field) 75 grid.field_parameters = old_params 76 grid.data = dict( [(k, grid.data[k]) for k in old_keys] ) /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __touch_grid_field(self, grid, field) 2370 @restore_grid_state 2371 def __touch_grid_field(self, grid, field): -> 2372 grid[field] 2373 2374 def _is_fully_enclosed(self, grid): /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in __getitem__(self, key) 147 """ 148 if not self.data.has_key(key): --> 149 self.get_data(key) 150 return self.data[key] 151 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in get_data(self, field) 190 else: raise 191 else: --> 192 self._generate_field(field) 193 return self.data[field] 194 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in _generate_field(self, field) 125 # First we check the validator 126 try: --> 127 self.pf.field_info[field].check_available(self) 128 except NeedsGridType, ngt_exception: 129 # This is only going to be raised if n_gz > 0 /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.pyc in check_available(self, data) 277 """ 278 for validator in self.validators: --> 279 validator(data) 280 # If we don't get an exception, we're good to go 281 return True /d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.pyc in __call__(self, data) 375 doesnt_have.append(f) 376 if len(doesnt_have) > 0: --> 377 raise NeedsDataField(doesnt_have) 378 return True 379 NeedsDataField: (['creation_time']) Best -R On Aug 21, 2011, at 9:24 AM, Matthew Turk wrote:
I've fixed the bug you have reported, but in the unstable (2.2-dev) version, which also includes a large number of performance improvements for the RAMSES code. (We hope to have a 2.2 release this week.) There seem to be a few lingering bugs with the RAMSES reader which I am going to work on tomorrow; it seems that something I did recently broke the reader.
Apologies for the rapid self-reply, but I believe I have identified and fixed the main issue I was seeing with the RAMSES reader, and as of changeset hash 677ae185471f (in the "development" branch) it should actually be performing up to specification, and I was able to project and slice data successfully. Tomorrow I will dive deeper and ensure that the second-tier tests are working up to specification.
RAMSES tests will be added to the automated test runner tomorrow morning, to be run on a daily basis, to ensure such a regression does not happen again. As always, please let us know if you run into problems.
Best,
Matt
-- Robert Feldmann Theoretical Astrophysics Group Fermi National Accelerator Laboratory Mail Stop 209, Box 500 Batavia, IL 60510, U.S.A E-mail: feldmann@fnal.gov Phone: +1 (630) 840-8433 Fax: +1 (630) 840-8231
Hi Robert, The cosmology_simulation flag was discussed on this mailing list about a week ago; the error message arises because RAMSES does not state explicitly whether it is in fact a cosmology simulation, so yt has to guess based on the units. The field you're running into is another particle field; as I noted earlier, the particle reading for RAMSES is not currently working. If you turn off particle writing (write_particles = False in the call to export_to_sunrise) and you have defined a "Temperature" field and a "Metal_Density" field for RAMSES (which yt does not do, as it has too many free parameters for the user) then it should execute to completion. (It does for me, with grossly incorrectly defined Temperature and Metal_Density fields.) To see which fields are available to define the "Temperature" and "Metal_Density" fields, you can inspect pf.field_info, which shows all of the existing fields. I would be more than happy to start a discussion of how to get star particles read in; my suspicion is that for the purposes of exporting to sunrise a very quick pass could be made at reading, rather than an involved load-on-demand scheme. I can attempt to extend the reader this week, if this is of interest. We should discuss it on the development list or IRC. Chris Moody was one of the initial implementors of the Sunrise exporter, for ART datasets; perhaps he can share a few of the tricks and sticky points in using it? -Matt On Sun, Aug 21, 2011 at 8:23 PM, Robert Feldmann <feldmann@fnal.gov> wrote:
Hi Matt,
Thanks for looking into it. Yet, the 2.2dev version still fails.
First, there is an issue when I load the RAMSES snapshot.
pf=load("output_00105/info_00105.txt") output_00105/amr_00105.out00001 yt : [INFO ] 2011-08-21 19:15:20,777 Parameters: current_time = -1.23236270587e+17 yt : [INFO ] 2011-08-21 19:15:20,777 Parameters: domain_dimensions = [2 2 2] yt : [INFO ] 2011-08-21 19:15:20,778 Parameters: domain_left_edge = [ 0. 0. 0.] yt : [INFO ] 2011-08-21 19:15:20,778 Parameters: domain_right_edge = [ 1. 1. 1.] yt : [ERROR ] 2011-08-21 19:15:20,778 Missing cosmological_simulation in parameter file definition!
Yet, despite this error message it does seem to read the RAMSES snapshot. These are the available fields
pf.__class__ pf.__repr__ pf._setup_nounits_units pf.has_key pf.__delattr__ pf.__setattr__ pf.basename pf.hierarchy pf.__dict__ pf.__sizeof__ pf.conversion_factors pf.keys pf.__doc__ pf.__str__ pf.current_time pf.parameter_filename pf.__format__ pf.__subclasshook__ pf.data_style pf.parameters pf.__getattribute__ pf.__weakref__ pf.dimensionality pf.print_key_parameters pf.__getitem__ pf._fieldinfo_class pf.directory pf.ramses_tree pf.__hash__ pf._handle pf.domain_dimensions pf.refine_by pf.__init__ pf._hash pf.domain_left_edge pf.storage_filename pf.__iter__ pf._hierarchy_class pf.domain_right_edge pf.time_units pf.__metaclass__ pf._instantiated pf.field_info pf.unique_identifier pf.__module__ pf._instantiated_hierarchy pf.file_style pf.units pf.__new__ pf._is_valid pf.fullpath pf.__reduce__ pf._parse_parameter_file pf.get_smallest_appropriate_unit pf.__reduce_ex__ pf._set_units pf.h
Then when I try to export it, I still 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 19:16:38,412 Re-gridding level 0: 1 octree grids Re-gridding 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 ... yt : [INFO ] 2011-08-21 19:16:44,489 Final grid count: 303 yt : [INFO ] 2011-08-21 19:16:44,534 Re-gridding level 16: 59069 octree grids Re-gridding 100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00 472552 yt : [INFO ] 2011-08-21 19:16:44,680 Final grid count: 153 int32 yt : [INFO ] 2011-08-21 19:16:45,227 Getting field particle_type from 3250 yt : [INFO ] 2011-08-21 19:16:45,433 Getting field particle_position_x from 3250 yt : [INFO ] 2011-08-21 19:16:45,647 Getting field particle_position_y from 3250 yt : [INFO ] 2011-08-21 19:16:45,858 Getting field particle_position_z from 3250 yt : [INFO ] 2011-08-21 19:16:46,085 Getting field particle_velocity_x from 3250 yt : [INFO ] 2011-08-21 19:16:46,304 Getting field particle_velocity_y from 3250 yt : [INFO ] 2011-08-21 19:16:46,523 Getting field particle_velocity_z from 3250 ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (1340, 0))
ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (54, 0))
--------------------------------------------------------------------------- NeedsDataField Traceback (most recent call last)
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/scripts/iyt in <module>() ----> 1 2 3 4 5
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/analysis_modules/sunrise_export/sunrise_exporter.pyc in export_to_sunrise(pf, fn, write_particles, subregion_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.current_time - reg["creation_time"][pi]) 113 creation_time = reg["creation_time"][pi] * pf["years"] 114
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __getitem__(self, key) 285 if key not in self.fields: 286 self.fields.append(key) --> 287 self.get_data(key) 288 return self.data[key] 289
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in get_data(self, fields, in_grids, force_particle_read) 2289 continue 2290 if field not in self.hierarchy.field_list and not in_grids: -> 2291 if self._generate_field(field): 2292 continue # True means we already assigned it 2293 # There are a lot of 'ands' here, but I think they are all
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in _generate_field(self, field) 2356 except NeedsGridType, ngt_exception: 2357 # We leave this to be implementation-specific
-> 2358 self._generate_field_in_grids(field, ngt_exception.ghost_zones) 2359 return False 2360 else:
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in _generate_field_in_grids(self, field, num_ghost_zones) 2366 def _generate_field_in_grids(self, field, num_ghost_zones=0): 2367 for grid in self._grids: -> 2368 self.__touch_grid_field(grid, field) 2369 2370 @restore_grid_state
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in save_state(self, grid, field) 72 old_keys = grid.data.keys() 73 grid.field_parameters = self.field_parameters ---> 74 tr = func(self, grid, field) 75 grid.field_parameters = old_params 76 grid.data = dict( [(k, grid.data[k]) for k in old_keys] )
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.pyc in __touch_grid_field(self, grid, field) 2370 @restore_grid_state 2371 def __touch_grid_field(self, grid, field): -> 2372 grid[field] 2373 2374 def _is_fully_enclosed(self, grid):
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in __getitem__(self, key) 147 """ 148 if not self.data.has_key(key): --> 149 self.get_data(key) 150 return self.data[key] 151
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in get_data(self, field) 190 else: raise 191 else: --> 192 self._generate_field(field) 193 return self.data[field] 194
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.pyc in _generate_field(self, field) 125 # First we check the validator
126 try: --> 127 self.pf.field_info[field].check_available(self) 128 except NeedsGridType, ngt_exception: 129 # This is only going to be raised if n_gz > 0
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.pyc in check_available(self, data) 277 """ 278 for validator in self.validators: --> 279 validator(data) 280 # If we don't get an exception, we're good to go
281 return True
/d/scratch39/feldmann/local/yt_dev/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.pyc in __call__(self, data) 375 doesnt_have.append(f) 376 if len(doesnt_have) > 0: --> 377 raise NeedsDataField(doesnt_have) 378 return True 379
NeedsDataField: (['creation_time'])
Best -R
On Aug 21, 2011, at 9:24 AM, Matthew Turk wrote:
I've fixed the bug you have reported, but in the unstable (2.2-dev) version, which also includes a large number of performance improvements for the RAMSES code. (We hope to have a 2.2 release this week.) There seem to be a few lingering bugs with the RAMSES reader which I am going to work on tomorrow; it seems that something I did recently broke the reader.
Apologies for the rapid self-reply, but I believe I have identified and fixed the main issue I was seeing with the RAMSES reader, and as of changeset hash 677ae185471f (in the "development" branch) it should actually be performing up to specification, and I was able to project and slice data successfully. Tomorrow I will dive deeper and ensure that the second-tier tests are working up to specification.
RAMSES tests will be added to the automated test runner tomorrow morning, to be run on a daily basis, to ensure such a regression does not happen again. As always, please let us know if you run into problems.
Best,
Matt
-- Robert Feldmann Theoretical Astrophysics Group
Fermi National Accelerator Laboratory Mail Stop 209, Box 500 Batavia, IL 60510, U.S.A
E-mail: feldmann@fnal.gov Phone: +1 (630) 840-8433 Fax: +1 (630) 840-8231
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (3)
-
Douglas Spolyar
-
Matthew Turk
-
Robert Feldmann