ttricco / sarracen

A Python library for smoothed particle hydrodynamics (SPH) analysis and visualization.
https://sarracen.readthedocs.io
GNU General Public License v3.0
15 stars 17 forks source link

1D surface density plot feature #65

Closed becnealon closed 8 months ago

becnealon commented 10 months ago

Suggestion to add a feature where you can easily calculate 1D surface density profile for a disc simulation. This exists in phantomanalysis and I've written a version in python, is it possible to make this an included feature?

Options for the user:

  1. Centre of simulation? where is the centre of the disc? Default should be 0,0,0.
  2. Which particles to consider? In a mixed simulation, should it be gas only or both gas and dust? Default should be the mixture.
  3. How to calculate the radius? Cylindrical, spherical or semi-major axis? Currently written in options for the first two, default should probably be cylindrical. Can add the third easily.

The routine I've written is only for gas particles, but you can see where the mass is chosen and that line will need to be edited appropriately for the gas/dust option. I also haven't added an option to rotate the disc against the total angular momentum but I think most people turn this off in the phantomanalysis anyway.

My routine calculates the surface density profile, angular momentum profile, scale height and averaged smoothing length/scale height - I think these are the core basics that most people use. I can't manage to attach my notebook here but I'll message it to you. I've tested it against phantomanalysis and it produces the same results, but some of the python is quite inefficient.