jzuhone / pyxsim

Simulating X-ray observations from astrophysical sources.
http://hea-www.cfa.harvard.edu/~jzuhone/pyxsim
Other
20 stars 8 forks source link

pyxsim example #39

Closed dustindnguyen closed 2 years ago

dustindnguyen commented 2 years ago

Hello,

I am trying to follow the pyxsim example: https://hea-www.cfa.harvard.edu/soxs/cookbook/pyXSIM_Example.html

When I get to the event creation I keep getting the error:


AttributeError Traceback (most recent call last) /var/folders/53/_3cvtjh10v9bmz7x2dn0xqf00000gn/T/ipykernel_6115/1836778752.py in ----> 1 n_events = pyxsim.project_photons("my_photons", "my_events", "z", (30.0, 45.0), 2 absorb_model="tbabs", nH=0.04)

~/anaconda3/lib/python3.8/site-packages/pyxsim/photon_list.py in project_photons(photon_prefix, event_prefix, normal, sky_center, absorb_model, nH, no_shifting, north_vector, sigma_pos, kernel, prng) 479 p = f["parameters"] 480 --> 481 data_type = p["data_type"].asstr()[()] 482 483 if sigma_pos is not None and data_type == "particles":

AttributeError: 'Dataset' object has no attribute 'asstr'

I have made sure all yt, pyxsim, and soxs versions are all up to date. Do you know why this error may be occurring for me?

Best regards, Dustin

jzuhone commented 2 years ago

Moving the conversation over here from Slack so that we can track it officially--asstr appeared in h5py 3.0. Let's double-check to make sure that's the version (or later) that you have.

dustindnguyen commented 2 years ago

Indeed, my h5py was not version 3.0. I assumed conda update h5py would have done it, but I was required to remove h5py and then re-install it. Thank you so much!