![](https://secure.gravatar.com/avatar/d9023e8f48f18e7aa8bf1e3dfabe31fb.jpg?s=120&d=mm&r=g)
Dear all: When I use the command Lightcore like: lc = LightCone('data/enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo', 0., 0.1, observer_redshift=0.0, time_data=False) I want to make a lightcore for Gadget simulation, so I change it as: lc = LightCone('multiphys.params', 'Gadget', 0., 0.1, observer_redshift=0.0, time_data=False) The command with Enzo can works well, while after changing to Gadget, it received a error report like: AttributeError: 'GadgetSimulation' object has no attribute 'all_redshift_outputs' May I know the reason for this, and does tihs command (Lightcore) apply only to the simulation with Enzo? Best Regards Xiaoli Lian
![](https://secure.gravatar.com/avatar/c1ca883bfb6bc32bcd9a65c5ec9b0bf9.jpg?s=120&d=mm&r=g)
Hi Xiaoli, It does look like the all_redshift_outputs attribute is only support by the EnzoSimulation class. However, you can disable the attempt to access that by setting both "redshift_data" and "time_data" to True when you create the LightCone. That will access the all_outputs attribute, which the GadgetSimulation class does have. This behavior should probably be cleaned up a little, but the above should work. Please let us know if it doesn't. Additionally, if you'd be interested in fixing the logic in the code so this error doesn't come up, a pull request would be very welcome! Britton On Fri, Apr 13, 2018 at 8:39 AM, lianxiaoli87 <lianxiaoli87@126.com> wrote:
Dear all: When I use the command Lightcore like: lc = LightCone('data/enzo_tiny_cosmology/32Mpc_32.enzo', 'Enzo', 0., 0.1, observer_redshift=0.0, time_data=False) I want to make a lightcore for Gadget simulation, so I change it as: lc = LightCone('multiphys.params', 'Gadget', 0., 0.1, observer_redshift=0.0, time_data=False) The command with Enzo can works well, while after changing to Gadget, it received a error report like: AttributeError: 'GadgetSimulation' object has no attribute 'all_redshift_outputs' May I know the reason for this, and does tihs command (Lightcore) apply only to the simulation with Enzo?
Best Regards Xiaoli Lian
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
![](https://secure.gravatar.com/avatar/3f7c9d217ccec8df891c4832f0b413ba.jpg?s=120&d=mm&r=g)
Thanks for Britton's guidance, and I trying this method using Gadget data. While I meet a new error like: AttributeError: 'NoneType' object has no attribute 'shape' no matter the key word -"filed" is sent to any filed of Gadget data. Sorry to disturb you again, and May I know what's wrong with my lightcore for Gadget data? Xiaoli Lian
![](https://secure.gravatar.com/avatar/7857f26c1ef2e9bdbfa843f9087710f7.jpg?s=120&d=mm&r=g)
Can you copy-paste the traceback you see along with that error? Unfortunately without that context it’s hard to say what’s going wrong except somewhere None is being used like an ndarray. On Sat, Apr 14, 2018 at 8:41 AM lianxiaoli <lianxiaoli87@sjtu.edu.cn> wrote:
Thanks for Britton's guidance, and I trying this method using Gadget data.
While I meet a new error like:
AttributeError: 'NoneType' object has no attribute 'shape'
no matter the key word -"filed" is sent to any filed of Gadget data.
Sorry to disturb you again, and May I know what's wrong with my lightcore for Gadget data?
Xiaoli Lian _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
![](https://secure.gravatar.com/avatar/3f7c9d217ccec8df891c4832f0b413ba.jpg?s=120&d=mm&r=g)
Hi Nathan, The traceback is given below: Traceback (most recent call last): File "./light_core_projection.py", line 35, in <module> njobs=-1) File "/home/xllian/.local/lib/python3.6/site-packages/yt/analysis_modules/cosmological_observation/light_cone/light_cone.py", line 325, in project_light_cone weight_field=weight_field) File "/home/xllian/.local/lib/python3.6/site-packages/yt/utilities/parallel_tools/parallel_analysis_interface.py", line 302, in barrierize return func(*args, **kwargs) File "/home/xllian/.local/lib/python3.6/site-packages/yt/analysis_modules/cosmological_observation/light_cone/light_cone_projection.py", line 84, in _light_cone_projection data_source=cut_region) File "/home/xllian/.local/lib/python3.6/site-packages/yt/data_objects/construction_data_containers.py", line 270, in __init__ self.get_data(field) File "/home/xllian/.local/lib/python3.6/site-packages/yt/data_objects/construction_data_containers.py", line 344, in get_data self._handle_chunk(chunk, fields, tree) File "/home/xllian/.local/lib/python3.6/site-packages/yt/data_objects/construction_data_containers.py", line 441, in _handle_chunk dl = chunk["index", "path_element_%s" % (ax_name)] File "/home/xllian/.local/lib/python3.6/site-packages/yt/data_objects/data_containers.py", line 281, in __getitem__ self.get_data(f) File "/home/xllian/.local/lib/python3.6/site-packages/yt/data_objects/selection_data_containers.py", line 823, in get_data if f.shape != ind.shape: AttributeError: 'NoneType' object has no attribute 'shape' Thanks Sincerely!
![](https://secure.gravatar.com/avatar/c1ca883bfb6bc32bcd9a65c5ec9b0bf9.jpg?s=120&d=mm&r=g)
Hi Xioli, I was not able to reproduce the error you posted. I tried making a light cone using the cookbook example <http://yt-project.org/docs/dev/cookbook/cosmological_analysis.html#light-cone-projection>, but using the gizmo_cosmology_plus <http://yt-project.org/data/gizmo_cosmology_plus.tar.gz> data. It ran for me to completion, although the image it gave suggests there are some problems with the tiling for slices where the width of the image is larger than the width of the simulation domain. Perhaps, you could try to see if you can get that error with the above gizmo_cosmology_plus data since that's public and we can use it to debug. Britton On Sat, Apr 14, 2018 at 11:46 PM, <lianxiaoli87@sjtu.edu.cn> wrote:
Hi Nathan,
The traceback is given below: Traceback (most recent call last): File "./light_core_projection.py", line 35, in <module> njobs=-1) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ analysis_modules/cosmological_observation/light_cone/light_cone.py", line 325, in project_light_cone weight_field=weight_field) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ utilities/parallel_tools/parallel_analysis_interface.py", line 302, in barrierize return func(*args, **kwargs) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ analysis_modules/cosmological_observation/light_cone/light_cone_projection.py", line 84, in _light_cone_projection data_source=cut_region) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ data_objects/construction_data_containers.py", line 270, in __init__ self.get_data(field) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ data_objects/construction_data_containers.py", line 344, in get_data self._handle_chunk(chunk, fields, tree) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ data_objects/construction_data_containers.py", line 441, in _handle_chunk dl = chunk["index", "path_element_%s" % (ax_name)] File "/home/xllian/.local/lib/python3.6/site-packages/yt/ data_objects/data_containers.py", line 281, in __getitem__ self.get_data(f) File "/home/xllian/.local/lib/python3.6/site-packages/yt/ data_objects/selection_data_containers.py", line 823, in get_data if f.shape != ind.shape: AttributeError: 'NoneType' object has no attribute 'shape'
Thanks Sincerely! _______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
![](https://secure.gravatar.com/avatar/3f7c9d217ccec8df891c4832f0b413ba.jpg?s=120&d=mm&r=g)
Hi Britton, I appreciate for your guidance, and I trying your method using my Gadget data. While I meet a new error like: AttributeError: 'NoneType' object has no attribute 'shape' no matter the key word - "filed" is set to any Gadget filed when using "Light_core_projection". I have no ideal about what's wrong with the Lightcore using Gadget data? Sorry to disturb you again, and Thank you one more time. Xiaoli Lian
participants (5)
-
Britton Smith
-
lianxiaoli
-
lianxiaoli87
-
lianxiaoli87@sjtu.edu.cn
-
Nathan Goldbaum