jzuhone / pyxsim

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

choosing line of sight #14

Closed Joshuaalbert closed 3 years ago

Joshuaalbert commented 5 years ago

Greetings,

I'm working with Julius Donnert on a project, and we're trying to create simulated Chandra observations from gridded data. I'm using https://github.com/jdonnert/Sph2Grid to turn Magneticum snapshots (gadgetv2) into gridded HDF5. Is it possible to control what the viewing angle is during the observation, i.e. along what axis the cluster is viewed.

Do you have a minimal example that would accomplish this simple goal from python?

Thanks in advance.

jzuhone commented 5 years ago

Hi @Joshuaalbert,

Since this is more of a pyXSIM question I will answer only here.

To answer your question from the SOXS issue you posted, pyXSIM works exactly like PHOX in that it loads the grid or particles in once to create the photons, and then allows you to project along as many lines of sight as desired. Once you create the PhotonList object, you use the project_photons method, and the first argument to this method is the projection direction, which can either be an axis ("x", "y", or "z") or a normal vector, e.g. [1.0, 2.0, -4.0].

Also, though we can definitely make your gridded HDF5 dataset to work, I should point out that pyXSIM also works with SPH datasets directly (like PHOX), so there is no need to grid it if you don't have to for some other reason.

Though this example in the pyXSIM documentation uses a grid-based dataset, it should work equally well if you use an SPH dataset with really no differences:

http://hea-www.cfa.harvard.edu/~jzuhone/pyxsim/cookbook/sloshing.html

Try modifying this for your use case and if you have any trouble to let me know.

jzuhone commented 5 years ago

@Joshuaalbert did you get this figured out?

Joshuaalbert commented 3 years ago

Digging this project up. Here is @MGJvanGroeningen who will work on it.

jzuhone commented 3 years ago

Closing the issue since the other issues were closed, please open a new one if necessary.