Skip to content

Commit

Permalink
updated quickstart guide and added option to install polaristools onl…
Browse files Browse the repository at this point in the history
…y (compile script)
  • Loading branch information
mlietzow committed Feb 19, 2024
1 parent aae3e04 commit 934e2e7
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 23 deletions.
24 changes: 19 additions & 5 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ These files can be opened with, for example, [SAOImageDS9](https://sites.google.
Simulations are performed similarly for thermal emission (`dust`) and stellar scattered radiation (`dust_mc`).
Please refer to the [command list](projects/CommandList.cmd) in the `projects` folder or the [manual](manual.pdf) (Table 2.4 - 2.10) for available options of the command file.

**HINT**: For thermal emission simulations, a temperature simulation has to be performed first.
**HINT**: For thermal emission simulations, a temperature simulation (`temp`) has to be performed first.

**HINT**: To include self-scattering, `<source_dust nr_photons = "Nph">` (`Nph` is the number of photon packages) and `<path_grid>` with the path to the grid file of the temperature simulation (e.g. "projects/disk/example/temp/grid_temp.dat") have to be provided in the command file (`dust_mc`).

**HINT**: `dust` simulations only include directly emitted radiation of the dust.
`dust_mc` simulations include directly emitted and scattered stellar radiation, scattered radiation thermally emitted by dust, but **not** directly emitted radiation of the dust.
Thus, the user has to combine the results of `dust` and `dust_mc` simulations to obtain a complete spectrum.

**HINT**: The previous results will be overwritten, if the same command file is used. Please change `<path_out>` in the command file to use a new directory for the new results.

Expand Down Expand Up @@ -165,9 +171,13 @@ $$

Additional parameter values to modify the model can be defined in the function `update_parameter` in the file `tools/polaris_tools_modules/model.py`.

**Hint**: For any changes in the files, the user has to recompile with:
**Hint**: For any changes in the files, the user has to recompile PolarisTools with:
```bash
./compile.sh -u
./compile.sh -t
```
or if compiled without the script:
```
python3 tools/setup.py install --user &>/dev/null
```


Expand All @@ -181,9 +191,13 @@ polaris-gen model_name grid_filename.dat
```
where `model_name` is the name of the model in the dictionary of `model.py`.

**Hint**: For any changes in the files, the user has to recompile with:
**Hint**: For any changes in the files, the user has to recompile PolarisTools with:
```bash
./compile.sh -u
./compile.sh -t
```
or if compiled without the script:
```
python3 tools/setup.py install --user &>/dev/null
```


Expand Down
43 changes: 25 additions & 18 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,26 @@ function update_installation()
fi
cd ".."

install_polaristools

source ${HOME}/.bashrc

exit
}


function install_polaristools()
{
# compile and install PolarisTools if available
# PolarisTools is no longer maintained and is not shipped with POLARIS anymore
if [[ -d "tools" ]]; then
cd "tools/"
python3 setup.py install --user &>/dev/null \
&& { echo -e "Compile and installing PolarisTools [${GREEN}done${NC}]"; echo ""; } \
|| { echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1; }
cd ".."
else
echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1;
fi

source ${HOME}/.bashrc

exit
}


Expand All @@ -313,15 +320,16 @@ function usage() {
echo ""
echo "usage: compile.sh [-h] [-frdu] [-c CXX_COMPILER] [-g CMAKE_GENERATOR]"
echo ""
echo "Install and compile POLARIS"
echo "Install POLARIS, PolarisTools, and optionally the cfitsio and CCfits libraries"
echo -e "${YELLOW}HINT:${NC} For first installation, use option -f"
echo ""
echo "optional arguments:"
echo "-h show this help message and exit"
echo "-f first installation (compile POLARIS and install the cfitsio and CCfits libraries)"
echo "-r clear and compile POLARIS (release mode) (default)"
echo "-d clear and compile POLARIS (debug mode)"
echo "-u re-compile POLARIS if necessary with last configuration (update)"
echo "-f first installation (compile POLARIS, PolarisTools, and the cfitsio and CCfits libraries)"
echo "-r clear and compile POLARIS and PolarisTools (release mode) (default)"
echo "-d clear and compile POLARIS and PolarisTools (debug mode)"
echo "-u re-compile POLARIS and PolarisTools if necessary with last configuration (update)"
echo "-t (re-)compile PolarisTools only"
echo "-c CXX_compiler"
echo " choose the c++ compiler you want to use:"
echo " - gcc (default)"
Expand All @@ -338,7 +346,7 @@ function usage() {
release=false
debug=false

while getopts "hfrduc:g:D" opt; do
while getopts "hfrdutc:g:D" opt; do
case $opt in
h)
usage
Expand All @@ -360,6 +368,11 @@ while getopts "hfrduc:g:D" opt; do
f)
DO_FITS=true
;;
t)
install_polaristools
source ${HOME}/.bashrc
exit
;;
c)
if [[ ${OPTARG,,} = "gcc" ]]; then
CXX="g++"
Expand Down Expand Up @@ -626,13 +639,7 @@ install_polaris

# compile and install PolarisTools if available
if [[ -d "tools" ]]; then
# go to PolarisTools dir
cd "tools/"

# compile and install PolarisTools
python3 setup.py install --user &>/dev/null \
&& { echo -e "Compile and installing PolarisTools [${GREEN}done${NC}]"; echo ""; } \
|| { echo -e "Compile and installing PolarisTools [${RED}Error${NC}]"; exit 1; }
install_polaristools

# set POLARISTOOLS_PATH as environment variable
set_envvar_TOOLS_str="export POLARISTOOLS_PATH=\"$HOME/.local/bin\""
Expand Down
Binary file modified quickstart.pdf
Binary file not shown.

0 comments on commit 934e2e7

Please sign in to comment.