diff --git a/README.md b/README.md index 1c224e521c3f5c59097fa3395c3b45bed651d65f..685f62f5a1b52910ea502a64abe271b852705fe7 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,58 @@ # Analyse isolated galaxy simulations and reproduce the plots from Ploeckinger et al. ([arXiv](https://arxiv.org/abs/2310.10721)) -The python routines to reproduce each figure from Ploeckinger et al. ([arXiv](https://arxiv.org/abs/2310.10721)) can be found here. For the figures showing results from the isolated galaxy simulations, the simulations have to be run first by following the instructions [here](https://gitlab.phaidra.org/softenedjeanscriteria/setup-galaxy-simulations). +The python routines to reproduce each figure from Ploeckinger et al. ([arXiv](https://arxiv.org/abs/2310.10721)) can be found in this repository. + +### Preparation **Required python packages:** - matplotlib - numpy - unyt -**Additional python packages required for individual plots** +**Additional python packages required for individual plots:** - astropy (Fig. 4) +- swiftsimio (Figs. 8, 9, 10) +- h5py (Figs. 9, 10) +- scipy (Fig. 11) + +**Set the path to the isolated galaxy simulations:** + +For the figures showing results from the isolated galaxy simulations (Fig. 8, 9, 10, and 11), the simulations have to be run first by following the instructions [here](https://gitlab.phaidra.org/softenedjeanscriteria/setup-galaxy-simulations). + +After all simulations have finished successfully, the path to the simulation folder needs to be set in `helpers/simulation_path.py` by updating this line: -### Fig. 1: Comparison between Newtonian and softened Jeans mass -Reproduce Fig. 1 with: +``` +simulation_path = "/PATH/TO/SIMULATION/FOLDER/setup-galaxy-simulations/" +``` + +**Reproduce individual figures:** +The individual figures from Ploeckinger et al. ([arXiv](https://arxiv.org/abs/2310.10721)) are reproduced by running the corresponding python scripts without any additional arguments. For example, Fig. 1 is reproduced with: ``` python3 Fig1_Jeans_mass_comparison.py ``` +### Comments for individual figures ### -**Comment:** -Easily adapt this figure to different constant Plummer-equivalent softening lengths by changing the line `eps = 100. # in pc`. -### Fig. 2: Illustration of the inaccuracy of the SPH-estimated density depending on a minimum smoothing length -Reproduce Fig. 2 with: +**Fig. 1: Comparison between Newtonian and softened Jeans mass** -``` -python3 Fig2_SPH_density_sketch.py -``` +Easily adapt this figure to different constant Plummer-equivalent softening lengths by changing the line `eps = 100. # in pc`. -**Comment:** -Re-running the figures can lead to slightly different results because the particle positions are random. The minimum smoothing length can be varied by changing the line `hmin_in_pc = 1.55 * 10. # minimum smoothing length in pc`. +**Fig. 2: Illustration of the inaccuracy of the SPH-estimated density depending on a minimum smoothing length** -### Fig. 3: Runaway collapse zone -Reproduce Fig. 3 with: +Re-running the figures can lead to slightly different results because the particle positions are random. The minimum smoothing length can be varied by changing the line `hmin_in_pc = 1.55 * 10. # minimum smoothing length in pc`. -``` -python3 Fig3_runaway_collapse_zone.py -``` +**Fig. 3: Runaway collapse zone** -**Comment:** The plotted resolution parameters can be updated by changing the lines that set `epsarr`, `mBarr`, and `h_min_ratio_arr` (see comments in the python script). -### Fig. 4: Runaway collapse zones examples from the literature -Reproduce Fig. 4 with: - -``` -python3 Fig4_runaway_collapse_zone_examples.py -``` +**Fig. 4: Runaway collapse zones examples from the literature** -**Comment:** The astropy python package is used to convert the over-density into a physical density for the Springel & Hernquist (2003) effective equation of state. If the relevant lines that add this line to the subplot are commeted out, the astropy package is not necessary. The parameters for some other simulation projects can be found in the python script and can be used for any of the subplots by modifying the call to `make_subplot`. Some examples are commented out under "other options" towards the end of the python script. -### Fig. 5: Gravitational stability at the length scale of a smoothing kernel (constant softening) -Reproduce Fig. 5 with: - -``` -python3 Fig5_zones_at_lsmooth.py -``` +**Fig. 5: Gravitational stability at the length scale of a smoothing kernel (constant softening)** -**Comment:** Change the plot for different resolution parameters by modifying the lines: ``` mB = [1.e5/8., 1.e5, 8.e5] # msun @@ -66,16 +60,10 @@ mB_default = 1 lsoft = [10., 20., 50., 100., 200., 500.] # pc lsoft_default = 3 ``` -Here, `mB_default` and `lsoft_default` are the indices for the default values for each panel. - -### Fig. 6: Gravitational stability at the length scale of a smoothing kernel (adaptive softening) -Reproduce Fig. 6 with: +Here, `mB` is the baryon particle mass in solar masses, `lsoft` the softening length in pc, and `mB_default` and `lsoft_default` are the indices for the default values for each panel. -``` -python3 Fig6_zones_at_lsmooth_adap.py -``` +**Fig. 6: Gravitational stability at the length scale of a smoothing kernel (adaptive softening)** -**Comment:** Change the plot for different resolution parameters by modifying the lines: ``` ######### Plot nr 1. ######## @@ -91,9 +79,25 @@ lsoftmin = 108. lsmoothmin = 0. mB = 8.5e4 ``` -to update the right panel. +to update the right panel. Here, `lsoftmin` is the minimum softening length in pc, `lsmoothmin` the minimum smoothing length in pc, and `mB` the baryon particle mass in solar masses. + +**Fig. 7: Gravitational stability within a smoothing kernel** + +Change the plot for different resolution parameters by modifying the lines: +``` + ######### Plot nr 1 ############### + mB = 1.e5 + epsarr = [100.] +``` +to update the left panel and +``` + ######### Plot nr 2 ############### + mB = 1.e5 + epsarr = [10., 20., 50., 100., 200., 500.] +``` +to update the right panel. Again, `mB` is the baryon particle mass in solar masses and `epsarr` is the softening length in pc. + -### Fig. 7: Gravitational stability within a smoothing kernel # Authors and acknowledgment S. Ploeckinger, University of Vienna