jzuhone / pyxsim

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

Empty photon list generated using pyxsim for a dataset generated from the IllustrisTNG simulation. #21

Closed sandhya0892 closed 3 years ago

sandhya0892 commented 5 years ago

Hi @jzuhone ,

I have generated the yt dataset for a halo from the IllustrisTNG simulation following your instructions from the previous issue(#20). However when I try generating a photon list using the command pyxsim.PhotonList.from_data_source(sp, redshift, area, exp_time, source_model) , I get the following output:

pyxsim : [INFO     ] 2019-05-31 16:07:31,366 Cosmology: h = 0.68, omega_matter = 0.31, omega_lambda = 0.69
pyxsim : [INFO     ] 2019-05-31 16:07:31,368 Using emission measure field '(PartType0, emission_measure)'.
pyxsim : [INFO     ] 2019-05-31 16:07:31,369 Using temperature field '(PartType0, Temperature)'.
pyxsim : [INFO     ] 2019-05-31 16:08:39,850 Finished generating photons.
pyxsim : [INFO     ] 2019-05-31 16:08:39,850 Number of photons generated: 0
pyxsim : [INFO     ] 2019-05-31 16:08:39,850 Number of cells with photons: 0

I have followed the example of 'Thermal emission from slashing cluster core'. The photon list generated is empty. Is there something I am missing?

Thanks and regards, Sandhya

jzuhone commented 5 years ago

In all likelihood you are not centered at the cluster. The example for the sloshing cluster core is special in that it uses a dataset where the cluster is centered at the domain center. This is not true for the clusters in IllustrisTNG. I would either find the center of your group halo using the TNG tools or use center="max"in the call to PhotonList.from_data_source.

sandhya0892 commented 5 years ago

Thank you once again @jzuhone ! It worked !

-Sandhya

Rudrani18 commented 4 years ago

Hello @jzuhone,

I am trying to read some _pickle files containing the information of the gas particles around AGN using 'load_particle' command. I then try to generate the photons using the command - photons=pyxsim.PhotonList.from_data_source(ad,redshift,area,exp_time,source_model,center=center,cosmology=cosmo)

where, redshift = 1.0 area = (3000., "cm**2") exp_time = (200., "ks") center = ad.center cosmo = Cosmology(hubble_constant=0.7, omega_matter=0.3, omega_lambda=0.7) source_model = pyxsim.ThermalSourceModel("apec", 0.1, 20.0, 10000, Zmet=0.5)

This is generating no photons.

pyxsim : [INFO ] 2020-02-29 12:15:47,223 Finished generating photons. pyxsim : [INFO ] 2020-02-29 12:15:47,223 Number of photons generated: 0 pyxsim : [INFO ] 2020-02-29 12:15:47,223 Number of cells with photons: 0

Could you please suggest me what modification is needed to get non-zero number of photons?

Regards, Rudrani

jzuhone commented 4 years ago

Hi @Rudrani18,

Can you also show the code which you do to setup the dataset with load_particles?

Rudrani18 commented 4 years ago

Hello @jzuhone ,

The code is as follows -

with open ('m_v_K15_dataEdt.p','rb') as fr: data = pl.load(fr) # 'm_v_K15_dataEdt.p' is the pickle file having the information of the gas particles around many black holes arr = data['9223372040010295661'].T # we are choosing the most active black hole and the information of gas particles around it

Dict = {'temperature': arr[0], 'density': arr[1], 'particle_position_x': arr[2], 'particle_position_y': arr[3], 'particle_position_z': arr[4], 'smoothing_length': arr[5], 'particle_mass' : arr[6], 'particle_velocity_x' : arr[7], 'particle_velocity_y' : arr[8], 'particle_velocity_z' : arr[9]}

bbox_lim = 5e5 # size of the region containing the information of gas particles around BH is 50 kpc

bbox = [[-bbox_lim,bbox_lim], [-bbox_lim,bbox_lim], [-bbox_lim,bbox_lim]]

ds = yt.load_particles(Dict, bbox=bbox) ad = ds.all_data()

jzuhone commented 4 years ago

Hi @Rudrani18,

sorry I am on vacation but hoping to get back to this soon.

jzuhone commented 4 years ago

Hi @Rudrani18, I want to get back to this now. Any chance you can open a new issue?

jzuhone commented 4 years ago

Hi @Rudrani18, can you check the coordinates of the particles to make sure that they fall within the box? It appears you are doing everything else correctly.

jzuhone commented 3 years ago

Closing this due to lack of discussion.