From a8548d80c8e6e45dc098c3ada138147172cac6b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sylvia=20Pl=C3=B6ckinger?= <sylvia.ploeckinger@univie.ac.at>
Date: Mon, 16 Oct 2023 09:29:12 +0000
Subject: [PATCH] Update README.md

---
 README.md | 74 ++++++++++++++++++++++++++++++++++---------------------
 1 file changed, 46 insertions(+), 28 deletions(-)

diff --git a/README.md b/README.md
index 165864f..78ccee1 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,9 @@ Reproduce the isolated disk galaxy simulations from Ploeckinger et al. (subm. 20
 ![Isolated disk galaxy](isolated_galaxy_examples.png "Stellar mass surface densities")
 
 
-## Installation
+## Preparation
+
+### Step 1: Install SWIFT
 The isolated galaxy simulations presented in Ploeckinger et al. (subm. 2023) use the [SWIFT](www.swiftsim.com) code (Schaller et al. [arXiv](https://arxiv.org/abs/2305.13380)). For reproducing these simulations install SWIFT following the information [here](https://swift.strw.leidenuniv.nl/docs/GettingStarted/index.html).
 
 This repository contains the parameter file used in these simulations. Note, that in the future, the required parameters for the individual modules may change. After installing all [dependencies](https://swift.strw.leidenuniv.nl/docs/GettingStarted/compiling_code.html#dependencies) of SWIFT successfully, the SWIFT version used in Ploeckinger et al. (subm. 2023) can be setup and compiled with
@@ -22,7 +24,9 @@ make
 
 If the code compiled successfully, the executables `swift` and `fof` are produced in the SWIFT folder. 
 
-In possibly another directory, clone this reposity with
+
+### Step 2: Customize the simulation folder and start the simulation
+At the path that the simulations should be run in, clone this reposity with
 
 ```
 git clone git@gitlab.phaidra.org:softenedjeanscriteria/setup-galaxy-simulations.git
@@ -31,47 +35,61 @@ cd setup-galaxy-simulations
 
 This repository contains the folder `fiducial_files` which requires the following changes:
 
-- copy the `swift` executable into the folder `fiducial_files`
+- copy the `swift` and `fof` executables into the folder `fiducial_files`
 - check the job submission `submit.job` and resubmission scripts `resubmit.job`, they might need updating or replacing, depending on the job submission system. The strings `RUNNAME` and `TIMEINHOURS` are replaced by the appropriate values by the `setup.py` script later.
 
+In the folder `data`, run the script `getall.sh` to load all necessary data for the simulations (ICs, tables for cooling, photometry, and yields):
 
+- `./getall.sh`
 
-## Name
-Choose a self-explaining name for your project.
+The `setup.py` script specifies which parameters are used. For Ploeckinger et al. (2023, subm.), we varied:
 
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
+- `mass_resolution_levels`: the mass resolution (level `M5` for a particle mass of 10<sup>5</sup>M<sub>sun</sub>, and `M6` for a particle mass of 8x10<sup>5</sup>M<sub>sun</sub>)
+- `softening_resolutions_in_kpc`: the constant gravitational softening length (Plummer-equivalent softening length, &epsilon;) 
+- `smoothing_resolutions_in_kpc`: the minimum smoothing length, h<sub>min</sub>
+- `star_formation_efficiencies`: the star formation efficiency per (Newtonian) free-fall time
+
+The default parameters start a subset of simulations with the `M6` mass resolution. These simulations are fast and can be used for testing. For the full set of simulations, comment and uncomment the relevant parameter blocks. 
+
+The simulations with the specified parameters are set up **and** submitted with
+
+```
+python3 setup.py
+```
 
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
+### Step 3: Rerun the simulations with very small hmin 
 
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
+We show in Ploeckinger et al. (2023, subm) that the SPH estimated densities are inaccurate representations of the particle positions, if the smoothing length, `h`, is limited by a minimum value, `hmin`. One of the simulation snapshots from the original simulation is converted into an initial conditions file (`data/create_ics_from_snapshot.py`) and the simulation is restarted with a very small value for `hmin` for one very short timestep. This is all done in the script `setup_reruns.py`:
 
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
+- Select the mass resolution level(s) that should be re-run and the snapshot number (default: `snapshotnumber = 100`, t = 1 Gyr).
 
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
+```
+python3 setup_reruns.py
+```
+
+### Step 4: Identify stellar clumps with the stand-alone fof routine
+
+For information on the stellar clumps that form within each simulation, the stand-alone FoF finder within SWIFT is used and setup with the script `setup_fof.py`.
+
+- Select the mass resolution level(s) that should be re-run and the snapshot number (default: `snapshotnumber = 100`, t = 1 Gyr).
+
+```
+python3 setup_fof.py
+```
 
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
+In this particular version of SWIFT, some parts of the standalone FoF routine might not be available but we only use the `fof_output_0000.hdf5` file for the analysis here, which is produced successfully. 
 
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
+# Step 5 Double-check and make plots
 
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
+If all simulation have finished successfully, the following folders and files should be present per mass resolution (here shown for the small test parameter subset):
 
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
+- `M6`: a subfolder is created for each run (e.g. `M6/GalaxyM6_soft0250pc_hmin007.75pc_sfe00.003`), containing the simulation snapshots (in particular: `output_0100.hdf5`)
+- `M6_reruns_snap0100`: a subfolder is created for each run in `M6` with the prefix `Rerun` (e.g. `M6_reruns_snap0100/RerunGalaxyM6_soft0250pc_hmin007.75pc_sfe00.003`) containing the output file produced after rerunning the simulation for one short timestep (`output_0000.hdf5`)
+- `M6_fofruns_snap0100`: a subfolder is created for each run in `M6` with the prefix `FOF` (e.g. `M6_reruns_snap0100/FOFGalaxyM6_soft0250pc_hmin007.75pc_sfe00.003`) containing the output file `fof_output_0000.hdf5`
 
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
+**If all these files are present, all figures from Ploeckinger et al. (2023, subm) can be reproduced with the plotting scripts from here.**
 
 ## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
+S. Ploeckinger, University of Vienna
 
-## License
-For open source projects, say how it is licensed.
 
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
-- 
GitLab